-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Support OpenAPI version 3.0 #165
Comments
+1 for this |
+1 |
Guys, please use the thumbs up emoticon rather than posting +1 comments. This is just noise for those being notified by email. If you want to help tackle this issue, you may dig in the OpenAPI 2 and 3 specs to spot differences, or maybe find a "what's new ?" or "migration howto" like this: https://www.blazemeter.com/blog/whats-new-in-swagger-open-api3 Here's what I noticed, already. PolymorphismThe use of (see this commit.) I don't think this is a breaking change. AFAIK, there was nothing about this in apispec and anyway, v3 is backwards compatible with v2 IIUC. Parameter locationshttps://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#parameter-locations
It differs slightly from OpenAPi v2: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#fixed-fields-7
This may have an impact on __location_map__ = {
'query': 'query',
'querystring': 'query',
'json': 'body',
'headers': 'header',
'cookies': 'cookie',
'form': 'formData',
'files': 'formData',
} It seems, though, that it is not just about updating that dictionary. From the link above:
@sloria, any thoughts about v2 vs. v3? It would be nice if we could maintain a single apispec version rather than two.
A comprehensive list of changes would help. Contributions welcome. |
I definitely would like to see support for v3 in apispec. That said, I personally do not need it for work or otherwise, and my time is very limited these days, so it's hard for me to put in the necessary time for this. I welcome any contributions! Thanks for doing that initial analysis, @lafrech .
I lean toward the former; apispec is generally permissive in what it allows; there aren't a lot of runtime checks for correctness to the OpenAPI spec. It would be great if OpenAPI v3 could be supported out-of-box without breaking apispec's API. |
Yes. What I thought, too. Glad that you confirm. Time limited on my side as well and no need to have this production ready right now. To potential contributors: listing v2/v3 issues here would be helpful already. Implementation can come in a second phase. On the other hand, small non-breaking patches are acceptable as well. No need to get the whole thing thought and done at once. |
OpenAPI 3.0 introduces writeOnly https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#fixed-fields-20
Also, it is acceptable in 3.0 to have a field both required and readOnly, in which case it means it must not be in a request but it is guaranteed to be in a response. In 2.0, required was designed mostly for requests and a field could not be both required and readOnly. OAI/OpenAPI-Specification#228
|
|
OpenAPI 3 adds
|
I don't a strong preference either way, but adding |
In OpenAPI 3, parameter objects are modified: v2, v3.
It's a bit more complicated than this, I'm afraid, but that's the rough idea. This is the reason that line was commented in the tests to allow the test to pass. Edit: This is fixed. I uncommented the line in the tests (#362) and they pass. |
https://swagger.io/docs/specification/api-host-and-base-path/
This affects code that relies on
|
@lafrech Can your previous comment be checked off, now that we've removed the path normalization code? |
Yes. Checked. |
Looks like we implemented all the changes we identified. Let's close this for now and declare apispec OpenAPIv3 compliant. If other adaptations are needed, we'll open dedicated issues. |
Is this released ? |
Yes. Since apispec 1.0.0. |
Hi there,
We're using APISpec with Marshmallow and aiohttp or sanic and it works really great.
There are some new great changes with OpenAPI (version 3) vs Swagger API (version 2).
Any plan to implement Open API version 3?
Thanks
Kind regards,
Raphaël
The text was updated successfully, but these errors were encountered: