I am writing swagger documentation(swagger.json) for my project(which is done and alive). Now i have a problem with modelling my object. I have a object called "Listing", Which is used to handle both "applications" and "services" internally.
Now in my definition i want to have two objects, one with applications related fields and one with service related fields . But i want to keep the name listing to both the objects,because in the swagger-ui i want the both of the objects to be displayed as listing(since the APIs are already used by users)
Any help?
Thanks.
Schema names must be unique, such as ApplicationListing
and ServiceListing
. But you can set the schema title
to customize the schema name displayed in Swagger UI.
definitions:
ApplicationListing:
title: Listing
description: Application listing
type: object
...
ServiceListing:
title: Listing
description: Service listing
type: object
...
With out adding unique named classes
, you can do this by customizing schema name
for swagger documentation
.
@Schema(name = "ApplicationListing")
and
@Schema(name = "ServiceListing")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With