Skip to content
Open
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 @@ -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;

Copy link
Contributor

Choose a reason for hiding this comment

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

goal is to always have a message after the @deprecated annotation so that any text coming after is not mistakenly interpreted to be the deprecation message.

the tsdoc spec requires that @deprecated annotation comes with a message.

.map(msg -> " " + msg)
.orElse(" see description");
String deprecationString = deprecatedTrait.getMessage().isPresent() ? "@deprecated" + deprecationMessage : "@deprecated";
docs = docs + "\n\n" + deprecationString;
}
docs = preprocessor.apply(docs);
Expand Down