SampleResponse {
moreDetails {
"something": "itsvalue" }
}responses: 200: description: |- this is my description schema: $ref: "#/definitions/SampleResponse"
definitions
SampleResponse: type: object properties: sampleDetails: type: object description: description of stuff $ref: "#/definitions/moreDetails"
moreDetails: type: object properties: something: type: string
description: the value for somethingHi Tom,
You can definitely define sub-object inline. It’s pretty much taking the content of the $ref and pouring it in place.
Taking your example:
definitions
SampleResponse:
type: object
properties:
sampleDetails:
type: object
properties:
something:
type: string
description: the value for something
The UI display changes based on how easy it is to show everything - it’s more about UX than it is about the structure behind.
As a side note, keep in mind that you cannot have additional properties alongside $ref like you have in the example above. Their values would be completely ignored.
--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/XfKi0_2HEYY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--