openapi-examples-validator
Version:
Validates embedded examples in OpenAPI-JSONs
74 lines (73 loc) • 1.5 kB
JSON
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
"license": {
"name": "MIT"
}
},
"servers": [
{
"url": "http://petstore.swagger.io/v1"
}
],
"paths": {
"/pets": {
"get": {
"summary": "Info for a specific pet",
"operationId": "showPetById",
"tags": [
"pets"
],
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"description": "The id of the pet to retrieve",
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"example": {
"code": 10,
"message": "An unexpected error has occurred."
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Error": {
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "number",
"minimum": 10,
"exclusiveMinimum": true
},
"message": {
"type": "string"
}
}
}
}
}
}