-
-
Notifications
You must be signed in to change notification settings - Fork 543
Support Swagger v3 #112
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
Comments
Bump. Is this enhancement in development? Should we expect it in foreseeable future? |
Hello! I haven’t started working on it yet, but plan to within the month. If anyone has realistic v3 Swagger definitions they’d like me to test, please post them here! I know that Swaggers docs contain examples, but I’ve usually found those to be too simple and not good for testing support. |
So this library is testing out support of v3 🎉 (see notes), but it’s in beta. Please try this against your existing v3 schema. If you encounter bugs, please post your full schema here (or the part of your schema that’s giving you trouble if you can’t post the full thing)! |
Hi! |
Hi, same issue here, just like @rikilele has. |
Hello, Same issue as @rikilele , company-reasoned schema censoring and everything. However, I can provide an example of something that isn't allowed in V2 but is now supported in V3.
For the record, the type of RoutingTable in the TS is this. I'm not saying that the parsed swagger should be like this, but using tsoa rendered the below interface to the above swagger doc.
|
Yes, same error and we need this to support the Open API spec or Swagger V3. Thanks! |
Thanks so much for everyone’s input. I’ve started on this this week proper, and when it’s ready I’ll open up an RFC and a test version to make sure it works with your schemas. I’m already excited with how it’s coming along! |
Update: I’ve started on a
You can also read more about the improvements here. I’ll post another message here when this Edit: 🤦♂️ I wrote |
Thanks for your work @DangoDev! I had trouble trying out the alpha version as shown in the comment above, since the available versions are
Now I can see that it generates the |
Just published a new I’m running it against Stripe’s 3.0 schema and able to build the entire thing. You can try it out with
🙏 feedback appreciated! Unless anyone experiences issues (in which case please share your schema), I think we’re close to releasing! 🎉 |
boy that was quick and impressive! 😎 I've tried it out and I was able to generate some types, but I've run into some issues. It seems that it does not cover the cases when the default value can be null. I've attached a sample schema below with which you can reproduce the issue. I've issued a PR that should fix this openapi: 3.0.1
info:
title: sample schema
version: LATEST
components:
schemas:
abstractName:
type: integer
format: int64
nullable: true
default: null |
Thanks for all the work on this @DangoDev! I had some issues with this file
|
@jfsiii thanks for the example file! That’s all I need to fix this. I’m sure it’s just a minor thing somewhere. Also thanks for taking time to test Would you be OK if I included your schema as part of this library’s tests? That way we can be sure that future changes are tested. But if you’re not comfortable with that I can always just abstract parts of it into the unit tests. |
@jfsiii OK found the issue: this library was expecting Also under This has been pushed in the latest pre-release, which you can try with: npx @manifoldco/swagger-to-ts@next … |
@DangoDev thanks for that. I see now that the input file was invalid. The generated types look great! I noticed they only contain |
There are now! I’m thinking maybe that’ll be the last addition for the swagger-to-ts |
On second thought, this seems to be part of the I think because that’s actually a major addition to the library (that I agree with), I’ll release the |
I’m going to close this issue. I believe I’ve taken care of everything raised here, but please open another issue on this library if I missed something. Thank you all! 🙏 |
Let’s support Swagger v3!
Should support the data types mentioned here: #92
The text was updated successfully, but these errors were encountered: