readOnly validation in nested refs is broken in 5.х release
xurc opened this issue · comments
xurc commented
It looks as if in the 5.x version (of JSON::Validator?), at least the readOnly validation in nested refs is broken. For example:
"Id": {
"type": "integer",
"title": "Id",
"description": "Id",
"format": "int32",
"readOnly": true
},
And, in another model:
"id": {
"$ref": "#/components/schemas/Id"
},
When validating, POST gives an error about the absence of id in the body.
If you change the spec version to "openapi": "3.1.0" and add readOnly to reference the model, as version 3.1 allows:
"id": {
"$ref": "#/components/schemas/Id",
"readOnly": true
},
the error is also present.
Presumably also broken validation of writeOnly, nullable etc.
Jan Henning Thorsen commented
Thanks for reporting in 👍 This should be fixed in the upcoming release of JSON::Validator. (v5.03)