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

Research the pros / cons of openapi-typescript / swagger-typescript-api #173

Open
ColinEberhardt opened this issue Mar 2, 2023 · 1 comment
Labels
enhancement New feature or request epic

Comments

@ColinEberhardt
Copy link
Collaborator

ColinEberhardt commented Mar 2, 2023

There are some a TypeScript-specific generators:

It's worth doing a bit of research on these solutions, what features do they offer that the forge lacks? pros / cons?

@ColinEberhardt ColinEberhardt added enhancement New feature or request epic labels Mar 2, 2023
@ColinEberhardt ColinEberhardt changed the title Research the pros / cons of openapi-typescript Research the pros / cons of openapi-typescript / swagger-typescript-api Mar 2, 2023
@OiNutter
Copy link

OiNutter commented Mar 3, 2023

We've used swagger-typescript-api on several projects on client and have generally been pretty happy with it. Not compared it to openapi-typescript so not sure what the pros and cons are of one vs the other but I can give some things we like and don't like about it:

Good:

  • Generated API code and request and response codes work really well (assuming you've got a good swagger spec), particularly being able to define enum types for fields.
  • Support for async and throwing errors on request failures makes for a nice clean interface, and adding the response body to an error is really helpful if you're sending back relevant info in the error response
  • Good CLI interface makes it easy to hook into postinstall npm hooks
  • Relatively easy to customise by linking in templates (handy when we had to fix a bug with uploading multiple files in one request)

Bad:

  • Doesn't clean out classes for schemas or requests that have been removed from the swagger. There is a clean option but it just seems to remove everything and not regenerate it, not sure if intentional or a bug but definitely an annoyance.
  • Uploading multiple files with fetch was a little buggy, might be fixed by now

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

No branches or pull requests

2 participants