fix: resolve @Hidden through the class hierarchy in Reader - #5342
Open
shamsManna wants to merge 1 commit into
Open
shamsManna wants to merge 1 commit into
shamsManna wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Readerreads@Hiddenwith the rawcls.getAnnotation(Hidden.class)andmethod.getAnnotation(Hidden.class), while every other annotation at those same two sites goes throughReflectionUtils.getAnnotation, which also walks superclasses, implemented interfaces and meta-annotations. So with the usual JAX-RS layout of an annotated API interface plus an implementation class, a resource or operation marked@Hiddenon the interface still ends up in the generated document thatOpenApiResource/OpenApiServletserve, exposing the path, its parameters and its request/response schemas.@Operation(hidden = true)on that same interface method is honoured, and@HiddenlistsANNOTATION_TYPEamong its targets but is never resolved as a meta-annotation either, so both reads now go throughReflectionUtils.getAnnotationlike their neighbours.Fixes:
Type of Change
Checklist
Screenshots / Additional Context
HiddenInheritedUserResourcecovers the three cases:@Hiddenon an interface method, on an interface type, and through a meta-annotation. On master all three resources are emitted (/user/internal,/admin,/metrics); with this change only/user/publicremains. Full./mvnw installis green, including theswagger-jaxrs2suite.