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

feat: support readOnly and writeOnly #547

Merged
merged 1 commit into from Apr 19, 2022

Conversation

NaridaL
Copy link
Contributor

@NaridaL NaridaL commented Apr 7, 2022

https://swagger.io/docs/specification/data-models/data-types/#readonly-writeonly

You can use the readOnly and writeOnly keywords to mark specific properties as read-only or write-only. This is useful, for example, when GET returns more properties than used in POST – you can use the same schema in both GET and POST and mark the extra properties as readOnly. readOnly properties are included in responses but not in requests, and writeOnly properties may be sent in requests but not in responses.
If a readOnly or writeOnly property is included in the required list, required affects just the relevant scope – responses only or requests only. That is, read-only required properties apply to responses only, and write-only required properties – to requests only.

@deepmap-marcinr deepmap-marcinr merged commit a4d612c into deepmap:master Apr 19, 2022
@NaridaL NaridaL deleted the read-write-only branch April 19, 2022 15:11
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
Co-authored-by: Adrian Leonhard <leo1fr@bosch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants