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

With @Schema annotated Classes (and Enums) are always added to generated open api definition #500

Open
HelvetiaAppDev opened this issue Nov 23, 2021 · 1 comment

Comments

@HelvetiaAppDev
Copy link

All Classes and Enums that are annotated with the @Schema annotation are automatically added to the generated open api definition.
This is not always intended, as those types should only be added if they are used as input or output (direct and indirect) in any of the exposed endpoints.

We have a library with pojos and some pojos have the @Schema annotation, mostly to add a description. Another project uses some pojos from that library but also has its own pojos. When we generate the openapi.yml for that project, all pojos with the schema annotation are included in the openapi.yml, even if they are not (transitively) included in any pojo that we expose over the REST API.

Is this intended behavior?
Is there a way to debug or find out, why those pojos are included?

@MikeEdgar
Copy link
Member

@HelvetiaAppDev, have you tried using the mp.openapi.scan.exclude.packages or mp.openapi.scan.exclude.classes property to ignore the POJOs you would like to keep out of the API definition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants