jsonschema-rs icon indicating copy to clipboard operation
jsonschema-rs copied to clipboard

Support "readOnly"

Open omid opened this issue 4 years ago • 5 comments

Hello,

Do we support "readOnly"? If yes, I couldn't figure it out, could you please lead me to a way to handle it? If no, then it's a feature request :)

omid avatar Jun 14 '21 15:06 omid

Hi! Do you mean Open API's readOnly?

Stranger6667 avatar Jun 14 '21 15:06 Stranger6667

Please, disregard my last comment. Those annotations are not supported.

Stranger6667 avatar Jun 14 '21 15:06 Stranger6667

What would be the expected behavior then? from the validation point of view

Stranger6667 avatar Jun 14 '21 15:06 Stranger6667

Just to reference for the futures, I meant this: https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.4

IMHO:

  1. The simplest expected behavior could be to return some errors.
  2. The more advanced is, to accept a default (or previous) list of values to pick from.

omid avatar Jun 14 '21 15:06 omid

Yep, the second one can be not related to validation, it's more sanitization. It's similar to replace the "default" values in the lack of field.

omid avatar Jun 14 '21 15:06 omid