Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for the readOnly property #133

Open
AlexeyMatskevich opened this issue Aug 19, 2023 · 1 comment
Open

Suggestion for the readOnly property #133

AlexeyMatskevich opened this issue Aug 19, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@AlexeyMatskevich
Copy link
Contributor

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.

@exoego exoego added the enhancement New feature or request label Sep 9, 2023
@exoego
Copy link
Owner

exoego commented Sep 9, 2023

I think this is a bit controversial change.

https://swagger.io/docs/specification/data-models/data-types/#readonly-write-only
image

readOnly properties are included in responses but not in requests, and writeOnly 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.

@exoego exoego added the help wanted Extra attention is needed label Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants