-
Notifications
You must be signed in to change notification settings - Fork 90
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
Adding a custom AnnotationScanner #1255
Comments
Hi @Raptoer, what is your requirement? There may be better-supported alternate approaches that rely on standard interfaces intended for application use. The |
I’m trying to read nonstandard annotations in order to alter the open api output. I’ve tried using filters, but by the time you’re at that stage you’ve lost the association to the original method you’re reading from.
… On Sep 13, 2022, at 1:44 AM, Michael Edgar ***@***.***> wrote:
Hi @Raptoer, what is your requirement? There may be better-supported alternate approaches that rely on standard interfaces intended for application use. The AnnotationScanner interface is an internal type and shouldn't necessarily be considered for use by applications.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
There are ways in that you can get the original method. We do it in Quarkus. See https://github.com/quarkusio/quarkus/blob/b60ad38c41ed42d34ec1fe86cc5934647c92440f/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoTagFilter.java#L51 as an example |
@Raptoer , what type of annotations are you dealing with? Something entirely custom to your application domain? |
So I'm trying to read @PreAuthorize, the spring security annotation, to somehow indicate on the openAPI document about the permissions required |
This sounds similar to https://github.com/quarkusio/quarkus/blob/main/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoRolesAllowedFilter.java If you create a small reproducer and the expected entries in the schema document, I can maybe build it in the above filter. |
The problem with these filters is that I'm using the maven plugin, and I'd rather not duplicate the expansive SmallRyeOpenApiProcessor that the quarkus extension uses. |
How did you obtain the class loader? I would expect if you use the class load of your filter, the application classes will be available. |
@raptor Can you check if the problem still occurs with the latest release (v3.11.0)? If so, can you provide a minimal reproducible example as asked above? |
Is is possible to add a custom AnnotationScanner in the project we're working with?
I know I could add it as a java service if I packaged it into a jar, but I want it to load from the project that the maven plugin is currently running on.
The text was updated successfully, but these errors were encountered: