How to exclude classes from becoming schemas?
gpsfl opened this issue · 3 comments
In our web application we have some endpoints which look like this:
@POST
@Path("/test")
public Response test(com.google.gson.JsonObject body) {}
This prompts the swagger-maven-plugin to create a schema for the JsonObject class from the gson library.
How can we exclude certain classes / packages from becoming schemata?
@gpsfl Based on the configuration docs, your best bet may be to move the test controllers you don't want to a separate java package and only specify the ones you want in the <locations>
element.
@marcogrcr This one is just an example. We have multiple regular calls which take JsonObject because we don't know the structure from the beginning or process it dynamically later on. It would be really helpful to have a way of excluding packages/classes from being converted to models.
@gpsfl I see. Given that the last commit on this project was almost 4 years ago (e4cf3af), you'll probably want to consider an alternative plugin. See #550 (comment). Though it's specifically for those seeking Open API 3.x standard support, this would probably apply to you as well.