I need to describe REST (JSON) API with OpenAPI (Swagger) syntax. I have stuck at the point when I need to describe nested request body. Please suggest how to make it, lets use as example the next nested request body:
{
"pauses" : [
{"name" : "PAUSING_AUTO"},
{"name" : "NO_PAUSE_CRITERIA","Min" : 15},
{"name" : "PREVENTED_PAUSE","Min" : 5},
{"name" : "REVERT_TO_RUN"},
{"name" : "RUNNING"}
]
}
The following description would do:
pauses:
type: "array"
items:
type: "object"
required:
- name
properties:
name:
type: "string"
Min:
type: "integer"