Skip to content

Commit

Permalink
Add deprecation message in shape docs (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Mar 15, 2024
1 parent a53fe36 commit ae49717
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ boolean writeShapeDocs(Shape shape, UnaryOperator<String> preprocessor) {
.replace("}", "\\}");
docs = preprocessor.apply(docs);
if (shape.getTrait(DeprecatedTrait.class).isPresent()) {
docs = "@deprecated\n\n" + docs;
DeprecatedTrait deprecatedTrait = shape.getTrait(DeprecatedTrait.class).get();
String deprecationMessage = deprecatedTrait.getMessage().orElse("");
String deprecationString = "@deprecated"
+ (deprecationMessage.isEmpty() ? "" : " " + deprecationMessage);
docs = deprecationString + "\n\n" + docs;
}
docs = addReleaseTag(shape, docs);
writeDocs(docs);
Expand Down

0 comments on commit ae49717

Please sign in to comment.