API Clients #16
-
Hi! I want to ask how do you generate API client libraries for the frontend - things written in JavaScript or TypeScript. I find GraphQL and gRPC have the huge benefit of the schema, thus allowing you to easily generate an API library. With REST APIs, you're kinda stuck writing Swagger / OpenAPI documentation which, to be honest, are very annoying to write. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I agree that OpenAPI is a pain. The resulting libraries are pretty ugly too. gRPC is a good option depending on the sophistication of your end user base. When I need to have a JSON API, I will typically create the client library by hand if I only need to support one or two languages (e.g. Go & JavaScript) but I'll use OpenAPI if I need to generate clients for a lot of languages. |
Beta Was this translation helpful? Give feedback.
I agree that OpenAPI is a pain. The resulting libraries are pretty ugly too. gRPC is a good option depending on the sophistication of your end user base.
When I need to have a JSON API, I will typically create the client library by hand if I only need to support one or two languages (e.g. Go & JavaScript) but I'll use OpenAPI if I need to generate clients for a lot of languages.