-
Notifications
You must be signed in to change notification settings - Fork 117
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 converting swagger (v2) spec to OpenAPI v3 #177
Comments
So basically the steps as I see it are:
|
That's correct. The structures and tests for (de-)serializing v3 spec should be easy enough, but the actual conversion may be complicated, so let's just focus on v2 to v3 in this issue, because that's what's needed for the plugin. |
How does conversion from v2 to v3 help for e.g. #97, where the structure cannot even be represented in v2 (iirc)? Shouldn't we rather implement generating v3 directly to support issues like #97? Edit: I see now that you plan to use "vendor extensions" to store the v3 data in v2 if I understood correctly. |
And comment @wafflespeanut ? |
Sorry, somehow missed this.
Paperclip codegen is written for v2. Having a separate v3 module will require significant changes in the codegen modules. Being an OpenAPI tooling library, v2 to v3 conversion (and vice versa) is something we should support anyway. So, I thought that we could just perform the conversions leveraging on vendor extensions (for idempotency) and reuse the codegen. For plugins, this would mean that they can stick to v2, and users can opt-in for v3 conversion if they wish to. That said, paperclip will still have a
For now, I'm only focusing on OpenAPI. Maybe we could have this in the future versions once OpenAPI support is complete. 😅
There isn't much. Few fields are renamed, some structural variations, and a bunch of features. |
Hey I landed here after a long journey of moving from Python to Rust and then actix-web and then hunting for something that would help me go from code to OpenAPI specs. paperclip to the rescue 🤗. thanks! After reading this thread I just wanted to point out that I think it is a mistake to focus too much on the old swagger/OpenAPi v2 spec. I am not an OpenAPI expert myself, but occasionally read some blog articles from Phil Sturgeon (the guy from https://apisyouwonthate.com/) and he seems to try to prevent people from "being stuck on old v2-based rubbish". At least in the Python world I am happy to say that most people seem to have moved on from swagger to OpenAPI v3. Also here (https://openapi.tools/) is a list of OpenAPI tools that paperclip should definitely be on (as only the second tool written for Rust!). |
OpenAPI v2 vs v3 is pretty much the Python 2 vs 3 problem - the only difference is that v2 hasn't reached EOL and people are still using it. I agree that we should focus more on v3 and I am planning to do that after 0.4.0 release. 😄 |
Yea the Python 2 vs 3 analogy is pretty spot on 😄 |
I'm starting on a small and simple project that may grow to a larger more complicated project, and I want to add OpenAPI v3. My past efforts of doing that manually have been a bit painful, so I'm adding paperclip with OpenAPI v2 with faith that I'll have v3 in the future. Keep up the good work! |
I have a project coming up with a DSL with v3 only client code generator. Is v3 coming soon? |
It does not look like it, track progress here. Probably needs some help from others to contribute, if you're short on time perhaps you can contribute financially via a bounty to encourage others to help out? |
I've got a PR open to convert internal v2 spec to v3 => #311 (waiting review..) |
This is useful for framework plugins which plan to use features from v3, in which case we'll use vendor extensions in v2 and convert it to v3.
The text was updated successfully, but these errors were encountered: