Validate API requests and responses against JSON Schema and OpenAPI specifications. Catch errors early with detailed validation reporting.
Choose the right schema standard for your API gateway
Common validation patterns for API gateway proxies
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://api.example.com/schemas/user",
"type": "object",
"required": ["name", "email"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"email": {
"type": "string",
"format": "email"
},
"age": {
"type": "integer",
"minimum": 0,
"maximum": 150
}
},
"additionalProperties": false
}
"paths": {
"/v1/chat/completions": {
"post": {
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["model", "messages"],
"properties": {
"model": {
"type": "string",
"enum": ["gpt-4", "gpt-3.5-turbo"]
},
"messages": {
"type": "array",
"items": { "$ref": "#/components/schemas/Message" }
}
}
}
}
}
}
}
}
}
}
Choose the right validation approach for your needs