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

add annotation to package docs when the service shape is deprecated #546

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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 @@ -756,6 +756,13 @@ public boolean writePackageShapeDocs(Shape shape) {
.map(DocumentationTrait::getValue)
.map(docs -> {
writePackageDocs(docs);
if (shape.hasTrait(DeprecatedTrait.class)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

rant: I see what they were trying to do with the shape API returning optional, but this whole setup is just awkward to do on map-streams. I'd rather have this as just imperative code at this point, but not blocking the review on this since the rest of the methods are written on this style

var message = shape.expectTrait(DeprecatedTrait.class)
.getMessage()
.orElse("This package is deprecated.");
writePackageDocs("");
writePackageDocs("Deprecated: " + message);
}
return true;
}).orElse(false);
}
Expand Down
Loading