rspec-openapi
rspec-openapi copied to clipboard
Suggestion for the readOnly property
I believe many people use id
or uuid
in their schematics. And always, this field is read-only.
I suggest to automatically set readOnly: true
for such fields.
I think this is a bit controversial change.
https://swagger.io/docs/specification/data-models/data-types/#readonly-write-only
readOnly
properties are included in responses but not in requests, andwriteOnly
properties may be sent in requests but not in responses
If I understand correctly, readOnly: true
indicates that that field id only in API responses.
I am not sure that id
or uuid
can be omitted in API requests for many people.
If someone wants to contribute to this, I suggest that this feature is disabled by default and requires a flag to enable it.