"parameters": [
{
"name": "body",
"in": "body",
"description": "Interesting description",
"required": true,
"schema": {
"$ref": "#/definitions/Position"
}
}
]
"Position": {
"description": "A single position",
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": [
{
"type": "number"
}
]
"Position": {
"description": "A single position",
"type": "array",
"minItems": 2,
"items": [
{
"type": "number"
},
{
"type": "number"
}
]
"Longitude": {
"title": "Longitudinal Value",
"description": "A valid longitude (-180 to 180).",
"type": "number",
"minimum": -180,
"maximum": 180,
"default": 0
},
"Latitude": {
"title": "Latitudinal Value",
"description": "A valid latitude (-90 to 90).",
"type": "number",
"minimum": -90,
"maximum": 90,
"default": 0
},
"Position": {
"description": "A single position",
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": [
{
"$ref": "#/definitions/Longitude"
},
{
"$ref": "#/definitions/Latitude"
}
],
"additionalItems": false
}
The spec doesn’t support multiple types under items, so you can’t really do that.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
You’re correct. The Swagger spec (now OpenAPI) supports an extended subsect of JSON Schema. One of the things it does not support is multi-types.
JSON Schema wise – that’s absolutely valid.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.