Allow (de)activating annotation scanners via the maven plugin config
Summary
When using the maven plugin for generating the openapi.json files, it's not possible to deactivate scanners that are not required. For example, we do not use spring or vert.x, but the scanners are running still. Also, this prevents us from extending the generated document with additional information.
The method OpenApiAnnotationScanner#scan already provides the means of filtering the scanners that are executed, but the maven plugin does not offer a way of setting the filter property. So it would be nice if that could be added.
Rationale
I found this discussion and we have the same problem basically, so I want to elaborate further:
We also want to extend the generated document with additional information, like special query parameters which are handled by jax-rs filters and therefore aren't present in the endpoint method signatures.
We tried to achieve that by subclassing the JaxRsAnnotationScanner, and adding the information after e.g. processResponse has been called since the context, the method info, and the operation are available there, and the information scanned from the annotations is already there. And generally, this does work as expected.
The only problem is that the added information gets overwritten if the original JaxRsAnnotationScanner is executed after our custom one. The order in which the scanners are called varies since they are loaded via the java ServiceLoader and stored in a hash map, and we found no reasonable way of making sure that our added information persists.
If we just could disable the other scanners, that would make things easier 😇.