Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): improve deprecatedTrait with default description #1541

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aBurmeseDev
Copy link
Contributor

@aBurmeseDev aBurmeseDev commented Mar 4, 2025

Description of changes:

  • Replace empty deprecation messages with "see description"
  • Check for deprecatedTrait message and render it properly

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

@aBurmeseDev aBurmeseDev marked this pull request as ready for review March 4, 2025 07:04
@aBurmeseDev aBurmeseDev requested a review from a team as a code owner March 4, 2025 07:04
@@ -225,9 +225,9 @@ boolean writeShapeDocs(Shape shape, UnaryOperator<String> preprocessor) {
if (shape.getTrait(DeprecatedTrait.class).isPresent()) {
DeprecatedTrait deprecatedTrait = shape.expectTrait(DeprecatedTrait.class);
String deprecationMessage = deprecatedTrait.getMessage()
.map(msg -> " " + msg)
.orElse("");
String deprecationString = "@deprecated" + deprecationMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

String deprecationMessage = deprecatedTrait.getMessage()
    .orElse("see description.");

String deprecationAnnotation = "@deprecated " + deprecationMessage;

docs = docs + "\n\n" + deprecationAnnotation;

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.

2 participants