Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"src/features_client/_private/endpoints.py": "90e1bc94c3ca6338b495b94870e7b1e433c1c2da064e336a85ad94616953916a",
"src/features_client/_private/schemas.py": "dd35b878aad2db78ea2903357eb190b596acc7c7723d3b49488ca3e7b360f916",
"src/features_client/aio/__init__.py": "2d6c204a7bbceeed5b175fe0df922722d341068027b29287cfdcbb9cb29403af",
"src/features_client/aio/client.py": "d85235a4bae36c1e2e0b63c319f96f3d3496445b70b322dc1cc948eec9d3de27",
"src/features_client/aio/client.py": "72e1e989866364a4a80f36056e177d67d519d5cab966dbae870f0a10f9f4fb81",
"src/features_client/aio/config.py": "0b8ab6e0648b479de7a9befe6742fbe72865bee2fab11a4533fbede79516e99a",
"src/features_client/aio/user_agent.py": "05cbb5932a96cb83d55ece172f9b9b5b8aeb625782140647e177d5d5cbd18dd5",
"src/features_client/client.py": "3e57e3c1c0b707e9c781d4d2fd69cd0f5b376cc9c26e7aeda68852fcfd33bf77",
"src/features_client/client.py": "43ec0fe0d6616d2d8f3219e481997b773cbd3e93035f8a6965ce04b652b14448",
"src/features_client/config.py": "8852d5679ab46123361451298ec619ee6506c6d0488fad2f940a29972e1cc755",
"src/features_client/models.py": "27b38abaebb0f568b92052d2c42dee9f804fcb00f15b25ef2c2f226e2d89ec96",
"src/features_client/models.pyi": "b0c577481ee04ac11b91b85eee3cf94de8eebbd977d95025b87736f3bc8c33f3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class AsyncFieldNotesClient(AsyncClient[AsyncFieldNotesConfig]):
An AWS service that uses every client feature the generator supports.

Its endpoint rules read config, input, and operation values. Its
operations
use SigV4, bearer token auth, API key auth, optional auth, and no auth.
operations use [SigV4](https://smithy.io/2.0/aws/aws-auth.html), bearer
token auth, API key auth, optional auth, and no auth.
"""

_client_plugins = (aws_user_agent_plugin, user_agent_plugin)
Expand Down Expand Up @@ -488,7 +488,13 @@ async def put_note(
**kwargs: Unpack[models.PutNoteInputDict],
) -> models.PutNoteOutput:
"""
Saves a note, signed with SigV4.
Saves a note, signed with **SigV4**.

- A new `NoteId` creates a note.
- An existing one replaces it.

Note:
Notes are stored in `arn:aws:notes:<Region>:<AccountId>`.

Args:
plugins:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class FieldNotesClient(Client[FieldNotesConfig]):
An AWS service that uses every client feature the generator supports.

Its endpoint rules read config, input, and operation values. Its
operations
use SigV4, bearer token auth, API key auth, optional auth, and no auth.
operations use [SigV4](https://smithy.io/2.0/aws/aws-auth.html), bearer
token auth, API key auth, optional auth, and no auth.
"""

_client_plugins = (aws_user_agent_plugin, user_agent_plugin)
Expand Down Expand Up @@ -488,7 +488,13 @@ def put_note(
**kwargs: Unpack[models.PutNoteInputDict],
) -> models.PutNoteOutput:
"""
Saves a note, signed with SigV4.
Saves a note, signed with **SigV4**.

- A new `NoteId` creates a note.
- An existing one replaces it.

Note:
Notes are stored in `arn:aws:notes:<Region>:<AccountId>`.

Args:
plugins:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"src/restjson_client/_private/schemas_2.py": "7af39a649f958d781c314de6dc5d0a1c1e6bc22cf46983ba834aabb461312b83",
"src/restjson_client/_private/schemas_3.py": "1edc1721aac792698841b83674d1306b373dd42bfd575f45df07da0ba34d882a",
"src/restjson_client/aio/__init__.py": "473fc51fef9cf762ab73c2de65aabd8036c7d440c7884bf017e4a02ad7b41ec5",
"src/restjson_client/aio/client.py": "15179137a737482c2231be2e804e5e944facd2ca479af1beb86ac88d4b247320",
"src/restjson_client/aio/client.py": "a09a810e37f8bf9585296d5e1677b14dbf736f3540b02a487a8d4fea6d9515ca",
"src/restjson_client/aio/config.py": "b5eafa46d3cb15f156f17932375ba8f3ceabd0fad1969a8b50bd3110c1e8b668",
"src/restjson_client/aio/user_agent.py": "8e6fb66d21c2c5e59ecf31b59db9566fb217d3f95a1af63ddcb47e637613afb9",
"src/restjson_client/client.py": "c13f41ef72f63849e43865341de01a7938b6c390f8acac4c2721b6257a2dc5a9",
"src/restjson_client/client.py": "c58f16622c5a04b50f4abdf066522da916839d216d6ddcfae51822f36068b57a",
"src/restjson_client/config.py": "48d53981c5e60fbd8ff8d4fb6e18de0124c6a2f90e43809045d63c32e087349e",
"src/restjson_client/models.py": "2ef5c492a6cf5922580732d19f28df88821bf8eb2c4ffaa8339ddc2d3c9cf52d",
"src/restjson_client/models.pyi": "199c69c5822a4daa522b52cd32935e7c42ea76443597c2566f7417b5efebc426",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3747,7 +3747,6 @@ async def test_body_structure(
used in all requests and that an "empty" body is
an empty JSON document ({}).


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3792,7 +3791,6 @@ async def test_get_no_input_no_payload(
(Content-Length, Content-Type) to operations that semantically
cannot produce an HTTP body.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3836,7 +3834,6 @@ async def test_get_no_payload(
(Content-Length, Content-Type) to operations that semantically
cannot produce an HTTP body.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3881,7 +3878,6 @@ async def test_payload_blob(
is used, and that we are not treating an empty body as an
empty JSON document.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3924,7 +3920,6 @@ async def test_payload_structure(
This enforces the same requirements as TestBodyStructure
but with the body specified by the @httpPayload trait.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3968,7 +3963,6 @@ async def test_post_no_input_no_payload(
These tests are to ensure we do not attach a body or related headers
(Content-Type) to a POST operation with no modeled input.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -4011,7 +4005,6 @@ async def test_post_no_payload(
These tests are to ensure we do not attach a body or related headers
(Content-Type) to a POST operation with no modeled payload.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3747,7 +3747,6 @@ def test_body_structure(
used in all requests and that an "empty" body is
an empty JSON document ({}).


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3792,7 +3791,6 @@ def test_get_no_input_no_payload(
(Content-Length, Content-Type) to operations that semantically
cannot produce an HTTP body.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3836,7 +3834,6 @@ def test_get_no_payload(
(Content-Length, Content-Type) to operations that semantically
cannot produce an HTTP body.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3881,7 +3878,6 @@ def test_payload_blob(
is used, and that we are not treating an empty body as an
empty JSON document.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3924,7 +3920,6 @@ def test_payload_structure(
This enforces the same requirements as TestBodyStructure
but with the body specified by the @httpPayload trait.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -3968,7 +3963,6 @@ def test_post_no_input_no_payload(
These tests are to ensure we do not attach a body or related headers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should preserve and treat double linebreak as an intentional paragraph

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

(Content-Type) to a POST operation with no modeled input.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down Expand Up @@ -4011,7 +4005,6 @@ def test_post_no_payload(
These tests are to ensure we do not attach a body or related headers
(Content-Type) to a POST operation with no modeled payload.


Args:
plugins:
Callables that change the configuration for this call only.
Expand Down
8 changes: 8 additions & 0 deletions designs/codegen/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@ runtime metadata. It covers `self`, `plugins`, defaults, and idempotency tokens.
Operation, paginator, and waiter method docstrings use Google style `Args:`,
`Returns:`, and `Raises:` sections, as in the Java generator.

Smithy documentation is CommonMark, which docstrings use as it is. AWS services,
those with `aws.api#service`, write it as HTML, which `smithy_python._docs`
converts to Markdown without Pandoc. Its output follows the Java generator's:
`-` list items, `Note:` and `Warning:` sections for `note` and `important`, no
`fullname`, and placeholders such as `<Region>` kept as inline code. On 6,000
sampled AWS documentation strings, 99% match the Java generator's text apart
from line breaks, and the rest differ only in layout.

## Supported Features

The generator supports non-streaming RPCv2 CBOR and RPCv2 JSON operations that
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "enhancement",
"description": "Generated AWS clients convert HTML documentation to Markdown docstrings, without Pandoc."
}
11 changes: 8 additions & 3 deletions packages/smithy-python/src/smithy_python/_client_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from textwrap import fill
from typing import TYPE_CHECKING, Final

from . import _auth, _endpoint_tests, _endpoints, _package, _pagination, _waiters
from . import _auth, _docs, _endpoint_tests, _endpoints, _package, _pagination, _waiters
from . import dependencies as _dependencies
from . import exceptions as _exceptions
from . import model as _model
Expand Down Expand Up @@ -615,7 +615,9 @@ def _write_client(
with writer.indent():
_models._write_docstring( # pyright: ignore[reportPrivateUsage]
writer,
_models._documentation(service) # pyright: ignore[reportPrivateUsage]
_models._documentation( # pyright: ignore[reportPrivateUsage]
service, _docs.documentation_is_html(service)
)
or f"Client for {service.id.name}.",
)
writer.line()
Expand Down Expand Up @@ -675,7 +677,10 @@ def _write_operation(
"] | None = None",
)
define = "async def " if mode.is_async else "def "
docs = _models._documentation(operation.operation) # pyright: ignore[reportPrivateUsage]
docs = _models._documentation( # pyright: ignore[reportPrivateUsage]
operation.operation,
_docs.documentation_is_html(plan.selection.service),
)
writer.line()
writer.line("@", _OVERLOAD)
writer.line(define, name, "(")
Expand Down
Loading
Loading