openapi-examples-validator
Version:
Validates embedded examples in OpenAPI-JSONs
131 lines (130 loc) • 3.68 kB
JSON
{
"swagger": "2.0",
"info": {
"title": "Simple API overview",
"version": "v2"
},
"paths": {
"/": {
"get": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"type": "object",
"required": [
"versions"
],
"properties": {
"versions": {
"type": "array",
"items": {
"type": "object",
"required": [
"status",
"id",
"links"
],
"properties": {
"status": {
"type": "string"
},
"updated": {
"type": "string"
},
"id": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"type": "object",
"required": [
"href",
"rel"
],
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
}
}
}
}
}
}
}
}
},
"examples": {
"application/json": {
"$ref": "./external-examples-invalid-type.json"
}
}
},
"300": {
"description": "300 response",
"schema": {
"type": "object",
"required": [
"versions"
],
"properties": {
"versions": {
"type": "array",
"items": {
"type": "object",
"required": [
"status",
"id",
"links"
],
"properties": {
"status": {
"type": "string"
},
"updated": {
"type": "string"
},
"id": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"type": "object",
"required": [
"href",
"rel"
],
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"consumes": [
"application/json"
]
}