Quarkus: quarks-openapi filter packages to scan for documenting. and support swagger annotations

Created on 3 Sep 2020  路  5Comments  路  Source: quarkusio/quarkus

Package to scan
It would be nice to have a feature to choose specific packages to be documenting and handling by openapi and swagger.
Because I was to document only public endpoints (generate HTML docs and swagger docs) and keep internal endpoints secret.
Support swagger annotations
I want to document endpoints and model class using annotations like @ApiModel, @Api,...
or the v3 swagger annotations like @Schema,...

Thanks.

areopenapi aresmallrye kinquestion

All 5 comments

/cc @EricWittmann, @MikeEdgar, @phillip-kruger

@mostafacs - have you tried the MicroProfile OpenAPI configuration properties?

https://github.com/eclipse/microprofile-open-api/blob/master/spec/src/main/asciidoc/microprofile-openapi-spec.adoc#311-core-configurations

Specifically:

  • mp.openapi.scan.packages
  • mp.openapi.scan.classes
  • mp.openapi.scan.exclude.packages
  • mp.openapi.scan.exclude.classes

@MikeEdgar Thanks. I will try it now. What about swagger annotations for documenting endpoints and models ?

@mostafacs , MicroProfile OpenAPI also has a set of annotations, listed on that same spec page: https://github.com/eclipse/microprofile-open-api/blob/master/spec/src/main/asciidoc/microprofile-openapi-spec.adoc#documentation-mechanisms

JAX-RS endpoints should automatically be scanned since they are annotated with @Path (unless excluded with one of the previously-mentioned properties).

Got it. thanks so much.

Was this page helpful?
0 / 5 - 0 ratings