I converted my jsonschema that works in the script to YAML format for swagger documentation. The issue is that in line 8 (-type: string) swagger shows error: should be object, 'items' must be an object.
type: object
properties:
answers:
type: array
minItems: 4
maxItems: 4
items:
- type: string
enum: ['Not really', 'Slightly', 'Significantly']
- type: string
enum: ['Not really', 'Slightly', 'Significantly']
- type: string
enum: ['Not really', 'Slightly', 'Significantly']
- type: string
enum: ['Yes', 'No']
Json schema
"type": "object",
"properties": {
"answers": {
"type": "array",
"items": [
{
"type": "string",
"enum": ["Not really", "Slightly", "Significantly"]
},
{
"type": "string",
"enum": ["Not really", "Slightly", "Significantly"]
},
{
"type": "string",
"enum": ["Not really", "Slightly", "Significantly"]
},
{
"type": "string",
"enum": ["Yes", "No"]
},
],
"minItems": 4,
"maxItems": 4,
}
},
}