Relative Content

Tag Archive for javaswaggerdocumentationopenapiswagger-ui

Swagger OpenAPI use class schema as ExampleObject

I have an endpoint with multiple possible request bodies, that have same parent class. I want to be able to switch between different examples (Request bodies/classes/schemas) in Swagger. Currently it only shows 1 body for any of this schemas. How can I set schema (Java class) as an example object in OpenApi Java?
This is what I work with in my controller: