openapi-examples-validator
Version:
Validates embedded examples in OpenAPI-JSONs
160 lines (159 loc) • 4.72 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",
"examples": {
"application/json": {
"versions": [
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
}
]
},
{
"status": "EXPERIMENTAL",
"updated": "2013-07-23T11:33:21Z",
"id": "v3.0",
"links": [
{
"href": "http://127.0.0.1:8774/v3/",
"rel": "self"
}
]
}
]
}
},
"schema": {
"type": "object",
"required": [
"versions"
],
"additionalProperties": false,
"properties": {
"versions": {
"type": "array",
"items": {
"additionalProperties": false,
"type": "object",
"required": [
"status",
"id",
"links"
],
"properties": {
"status": {
"type": "string"
},
"updated": {
"type": "string"
},
"id": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"additionalProperties": false,
"type": "object",
"required": [
"href",
"rel"
],
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"300": {
"description": "300 response",
"schema": {
"type": "object",
"required": [
"versions"
],
"additionalProperties": false,
"properties": {
"versions": {
"type": "array",
"items": {
"additionalProperties": false,
"type": "object",
"required": [
"status",
"id",
"links"
],
"properties": {
"status": {
"type": "string"
},
"updated": {
"type": "string"
},
"id": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"additionalProperties": false,
"type": "object",
"required": [
"href",
"rel"
],
"properties": {
"href": {
"type": "string"
},
"rel": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"consumes": [
"application/json"
]
}