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

Change OpenAPI generator under the hood #31

Open
dani-z opened this issue Nov 1, 2023 · 5 comments
Open

Change OpenAPI generator under the hood #31

dani-z opened this issue Nov 1, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@dani-z
Copy link

dani-z commented Nov 1, 2023

Hi,

First of all I want to thank you for creating this great lib, it saved me a lot of hours of development.
I just wanted to ask if you considered swapping the OpenAPI generator under the hood, or if there is any way it can be done in the client implementation. Reason is, my API is using the discriminator mapping feature and currently the typescript generator does not support it (ferdikoomen/openapi-typescript-codegen#998 (comment))

I was looking at https://github.com/OpenAPITools/openapi-generator-cli and they seem to have it.

Thanks for your help

@7nohe
Copy link
Owner

7nohe commented Nov 1, 2023

@dani-z I think it's likely possible to switch the OpenAPI generator under the hood.

At the moment, there are other OpenAPI generator libraries available, so I recommend considering those as well. They might support discriminator mapping.

It seems that these libraries also support custom hook generation for Tanstack Query.
You can see more community projects for Tanstack Query here.

@7nohe 7nohe added the enhancement New feature or request label Nov 1, 2023
@dani-z
Copy link
Author

dani-z commented Nov 2, 2023

@7nohe, thanks for the recommendations, I will definitely check them out.

@seriouslag
Copy link
Collaborator

seriouslag commented Apr 15, 2024

@dani-z we have changed the underlying OpenAPI typescript generator to @hey-api/openapi-ts.

I am unsure if the library handles your use case, but they are in active development.

An issue created there, if they do not support it, may be helpful.

@dani-z
Copy link
Author

dani-z commented Apr 16, 2024

Thanks @seriouslag I had a look at @hey-api in the past, they do indeed seem to be way more active. I guess you could close this issue or make it as a Discussion if you use those.
Ideally there will be a configurable way to use what ever generator under the hood, but I am unsure of how complex that could be.

@seriouslag
Copy link
Collaborator

Thanks @seriouslag I had a look at @hey-api in the past, they do indeed seem to be way more active. I guess you could close this issue or make it as a Discussion if you use those.

Ideally there will be a configurable way to use what ever generator under the hood, but I am unsure of how complex that could be.

That code will add complexity but that abstraction would be great so we could change generators if needed.

I am not opposed to it being added and if you are up for the task to try, we can collaborate on it.

Personally I feel we should try and enhance @hey-api/openapi-ts as they are responsive and listen to requests.

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

3 participants