I’ve turned OFF the option to Allow Objects to have additional Properties and it is not working as I expected.
I’m getting that validation failed with this error validation errors:
- $ should not have additional properties statusCode
- $ should not have additional properties message
- $ should not have additional properties error
- $ should not have additional properties statusCode
- $ should not have additional properties message
- $ should not have additional properties error
- $ should match some schema in “anyOf”
This is my response body on the request:
{
"statusCode": 404,
"message": "No matching information for the input",
"error": "Not Found"
}
here is my schema:
{
"title": "response",
"description": "Generic response format for service error conditions",
"type": "object",
"properties": {
"statusCode": {
"type": "integer",
"format": "int64",
"minimum": 400,
"maximum": 599,
"examples": [
400
]
},
"message": {
"oneOf": [
{
"type": "array",
"maxItems": 1024,
"items": {
"type": "string",
"minLength": 0,
"maxLength": 10240
}
},
{
"type": "string",
"minLength": 0,
"maxLength": 10240
}
]
},
"error": {
"type": "string",
"maxLength": 1024,
"examples": [
"Bad request"
]
}
},
"required": [
"statusCode"
],
"anyOf": [
{
"required": [
"message"
]
},
{
"required": [
"error"
]
}
],
"x-apidog-orders": [
"statusCode",
"message",
"error"
]
}