-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
OpenAPI v3 support #420
Comments
I have this blog post in my read buffer. 😄 To be honest I haven't thought too much about the OpenAPI 3 in Connexion so far. But definitely it is time to start considering it. I will follow up in this thread later when I give this topic some more thought. Thank you for opening this issue. If anyone have ideas/suggestions or is willing to help in this I will be glad to support. |
Cool. I'm open to help in a near future, especially when in my team we can start considering OpenAPI 3 adoption across our services. |
I need to get up to speed on version 3 and would then like to help. |
Just went over the new OpenAPI 3.0 which looks quite nice. I'm also curious as to when we may consider supporting it in Connexion. :-) |
Will we try to simultaneously support both versions 2 and 3? Although more work, my assumption is this would be the way to go, otherwise we will break a lot of APIs currently built with Connexion. |
@danballance Yes, we will support both. We will try to reuse as much as possible the codebase we have. As side note, I am working on a sketch of the support for OpenAPI v3. |
Hey @rafaelcaricio just wanted to ask if you guys have made any progress on this and if you might need any form of testing. |
@JuxhinDB Unfortunately no. I'm currently busy with some personal stuff and with little free time to take care of this right now. :( |
That's fine, @rafaelcaricio! Feel free to ping me in the future should you need any help with this. |
support for 3.0 would be awesome. Parameter and anchor references are much flexible and it can mean less repeated code to document the same API. |
The OpenAPI 3.0 spec was finalized and released a couple of weeks ago: https://www.openapis.org/blog/2017/07/26/the-oai-announces-the-openapi-specification-3-0-0 |
public API endpoints This achieves the following goals: * It's possible to programmatically generate the docs from the swagger spec (see: https://github.com/Rebilly/ReDoc) * It's easier to enforce better request argument normalisation and avoid stupid type casting bugs at the source * It reduces the overall amount of boilerplate needed to do common API tasks Currently I use Open API 2.0 instead of 3.0 because the connexion (the library that implements the swagger spec doesn't support 3.0 yet. See: spec-first/connexion#420)
Hi, if anyone is willing to guide me through with an email or two on the codebase, I may try to help with some progress on OpenAPIv3 support. If so feel free to ping me. :-) |
Any roadmap for support for v3? |
Any update on this? This would be awfully handy! |
I've been making some progress on a branch https://github.com/dtkav/connexion/tree/oas3 |
@dtkav sounds great! |
@dtkav -- Some time next week I would love to check out the work and see if I can provide you with any help, even if it's just testing related. :-) |
I'm looking for feedback on ways to approach the problem of supporting swagger2 and oas3 simultaneously. I can imagine a few approaches:
I've put a little bit of time into options 1, and 2. I'll probably give 3 a shot next and report back. Let me know what you all think! I'm currently leaning toward option 3 because it would delegate the responsibility of backwards compatibility and keep the code clean. Unfortunately that strategy isn't very incremental, so I imagine it will be tough to upstream. |
@dtkav I would be fine with option 1 (incremental changes) as it would leverage existing tests and add new tests for OpenAPI v3. This then would be a solid base to do a bigger refactor like proposed with option 3. Maybe I'm too pragmatic and not so much into the code anymore, so take my opinion with a grain of salt 😏 |
Just to add my 2c -- given the man power for this, I also feel option 1 makes most sense where we can leverage as much of the current framework as we can to build on top of. I will dedicate some time next week to help out with implementation/testing where possible. |
cool - thanks team! @JuxhinDB thanks - I'm keen to have someone to bounce ideas off of - little things keep coming up. with swagger2:
However, this is a significant workflow difference between swagger2 and oas3, and is potentially difficult to support for the different webservers (flask, aiohttp, etc). Let me know what you think! |
@dtkav I would propose passing the body as a parameter (option 2) and would try to make it smart, i.e. it should work for existing function signatures (last argument is the body parameter) and we could make it configurable via some |
@JuxhinDB if you can click the "review changes" button next time, that would record your review and approval with the commit. |
@dtkav -- Done, cool feature that I got to learn. :-) Later today I'll go over the other bigger PR and give my thoughts. |
This is probably an awful hack, but I just put this in my file that I run with pip install -r: # connexion git+https://github.com/dtkav/connexion.git@oas3#egg=connexion |
@jmcs thanks for the merge! @JuxhinDB thanks a lot for the review of #639 ! |
I just found an new edge case with form parameters in OpenAPI 3 from a test case that had I added to master a while back. I need to work out array handling for form parameters that come in through the requestBody in oas3, so I'm going to put the WIP tag back on the diff. I'll update again when It's ready for review. |
Sounds good @dtkav -- feel free to ping me if you would like eyes on certain diffs. |
Thanks @JuxhinDB I really appreciate it. |
To anyone who is able - please review #621 - it adds support for OpenAPI 3 specs! |
I went over the PR and overall I didn't notice any glaring issues. That said, it would be best if someone with Swagger2/OpenAPI3 experience went over it from a spec perspective |
Thanks @JuxhinDB ! Do you mind going through the review process (click the review button, leave comments, etc)? |
Wholehearted thanks for the review @JuxhinDB - I'm going to leave the PR open for the rest of the week to give others a chance. By default I'll merge this PR into dev-2.0 on Monday unless: |
Some validations are not working yet. In a post request body
It will fail the validation when bootstrapping the app.
This is the issue from python-openapi/openapi-spec-validator#46 anyway. |
hey @lihan - thanks for opening that issue. I'll take a look over on the openapi-spec-validator project. |
whoops, I pressed the wrong button, sorry! |
@lihan which version of
function args: () |
While debugging your issue, I discovered that discriminator is not part of jsonschema, so I'll probably need to add that to the validator somehow. Feel free to contribute tests cases for important use cases that you have. |
I've merged #621 (OpenAPI 3.0.0 Support) into the dev-2.0 branch 🎉 |
Next up are:
|
Closing with the release of 2.0 (https://github.com/zalando/connexion/releases/tag/2.0.0) 😄 |
Thanks to @dtkav and all the team for this great release! |
Thanks for everyone's hard work and collaboration! |
Big well done guys, loved the collaboration! |
Just curious about OpenAPI 3 support plans.
See related post about Swagger 2 and OpenAPI 3 introduction:
https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/
The text was updated successfully, but these errors were encountered: