swagger-parser
swagger-parser copied to clipboard
Required readonly properties should fail with Swagger 2
EDIT: Upon closer inspection, the spec says "SHOULD NOT" not "MUST NOT". Meaning this is merely bad practice, not an error
According to the Swagger 2 spec, readOnly properties are not allowed to be required. The following schema should fail, but does not.
{
"swagger": "2.0",
"info": {
"title": "Parser Bug",
"version": "3.5.1"
},
"paths": {},
"definitions": {
"Burn": {
"properties": {
"id": {
"type": "string",
"readOnly": true
}
},
"required": [
"id"
],
"type": "object"
}
}
}
This does not apply to OA3
The openapi-enforcer handles this correctly.