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

Support for OpenAPI v2? #22

Open
dimitropoulos opened this issue May 23, 2021 · 3 comments
Open

Support for OpenAPI v2? #22

dimitropoulos opened this issue May 23, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@dimitropoulos
Copy link

Hi! Thanks for opensourcing it, I'm using it in https://github.com/dimitropoulos/definitely-generated-typed

The trouble is, Kubernetes only has OpenAPI v3 as an option and it generates types that are not really usable (and, crucially, incomplete. For example note that https://github.com/dimitropoulos/definitely-generated-typed/blob/master/types/kubernetes/versions/v1.20.0/index.ts is missing a type for IngressSpec (https://raw.githubusercontent.com/dimitropoulos/definitely-generated-typed/master/types/kubernetes/versions/v1.20.0/source.json).

It's pretty compact, where I'm grabbing the schema, so hopefully I'm not just doing something wrong: https://github.com/dimitropoulos/definitely-generated-typed/blob/master/generate.ts#L72-L75.

If it's possible to use the openapi v3 parser (as I am) and get these definitions, that'd be enough to get the ball rolling.

@dimitropoulos dimitropoulos added the enhancement New feature or request label May 23, 2021
@SomaticIT
Copy link
Contributor

Hi!

Thank you. We are very happy to learn that this project is used to power up an ambitious project like definitely-generated-typed. I like the concept of building a central repository with generated types.

We've built @spec2ts/openapi with OpenAPI v3+ compatibility to avoid managing legacy code and avoid having too much edge cases. The future is v3+ 😁 !

However, you can take a look at swagger2openapi. It's a simple library that can convert swagger (2.0) files to OpenAPI (3.0) files.

Could this works for you?

@dimitropoulos
Copy link
Author

I don't think so, but I'll give it a try. Gotta be better than nothing. I'll update you here when I get to it (could be a few days, this is an after-hours side-project, presently).

@SomaticIT
Copy link
Contributor

I think this could do the job. It's a mature library which is used in production by many.
Let me know of the results of your tests. I will try to help if I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants