Skip to content

Conversation

@arandito
Copy link
Contributor

Description

Fixed an issue in doc string generation where special characters (specifically $) in the Smithy model's documentation traits were being incorrectly interpreted as Smithy format specifiers (docs).

The fix adds the $L formatter to write() and writeInline() calls in MarkdownToRstDocConverter.java, ensuring doc strings are treated as string literals rather than as format expressions. This prevents the unintended interpolation of doc strings that contain characters like $.

Testing

Successfully rebuilt aws-sdk-bedrock-runtime client and ensured no changes were reflected in docstrings.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@arandito arandito requested a review from a team as a code owner October 21, 2025 22:26
@arandito arandito requested review from jonathan343 and ubaskota and removed request for jonathan343 and ubaskota October 21, 2025 22:32
Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR!

I think this looks good. We should consider adding some test coverage to this file: https://github.com/smithy-lang/smithy-python/blob/3c3bacffdcfeda6dfede98a780e107a60bb8ac4f/codegen/aws/core/src/test/java/software/amazon/smithy/python/aws/codegen/MarkdownToRstDocConverterTest.java. Maybe something simple like being able to handle the $ character and any other cases you're aware of

@ubaskota
Copy link

LGTM. Please, address Jonathan's comments before merging.

ubaskota
ubaskota previously approved these changes Oct 22, 2025
@arandito
Copy link
Contributor Author

Added a unit test to cover case where HTML string has the character $. This will also cover any future format specifiers as we are treating the entire string as a literal.

Ran make build-java to ensure test fails with the current state on develop and that it passes with the PR fix.

Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Antonio!

@arandito arandito merged commit 1c0a955 into smithy-lang:develop Oct 22, 2025
4 checks passed
alexgromero pushed a commit to alexgromero/smithy-python that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants