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

readOnly / writeOnly support for OpenAPI 3.1 #76

Open
fivepapertigers opened this issue May 16, 2023 · 1 comment
Open

readOnly / writeOnly support for OpenAPI 3.1 #76

fivepapertigers opened this issue May 16, 2023 · 1 comment

Comments

@fivepapertigers
Copy link

Seems like read/write context-aware validators are only implemented for OpenAPI 3.0. Any reason not to implement a similar interface for 3.1?

For some context, I'm leveraging the openapi-core library and noticing that readOnly and writeOnly work great when validating against 3.0 specs, but do nothing with 3.1 specs.

@p1c2u
Copy link
Collaborator

p1c2u commented Jun 12, 2023

The answer is very simple, because OpenAPI 3.1 specification doesn't define readonly/writeonly.

the reason can be found here

When discussing the final details of aligning with JSON Schema, we identified there was particularly thorny issues with the readOnly and writeOnly properties that are defined in JSON Schema but described to have slightly different behavior in OpenAPI. In order to achieve our goal of full alignment with JSON Schema, we had to drop the OpenAPI behavior. Technically, this change might “break” some piece of tooling out there. We haven’t found it yet (we’re still looking). Semantic versioning would insist that this change be denoted as 4.0.0. However, this update to the specification is not such a major update, rather there are a few small breaking changes.

https://www.openapis.org/blog/2020/06/18/openapi-3-1-0-rc0-its-here

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

No branches or pull requests

2 participants