You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing out openapi-typescript-codegen which seems like a really good & fast option to create a typescript client, but found a major hurdle.
When generating clients from an OpenAPI spec, it's common to expose a service class with one method per endpoint. Usually you won't be able to create a class method containing the slashes in the request path (ex: api/buyer/get), so generators will use the optional operationId and tags fields to define method names.
For example, in hulk the /api/v1/buyer/create-buyer-branch could be assigned { tags: ["buyer"], operationId: "createBuyerBranch" } so the resulting client looks like:
hulk.buyer.createBuyerBranch({ ... })
Alternatively, an option to use the path itself as operationId in the output json would be enough to generate useful method names. I've opened an issue at ferdikoomen/openapi-typescript-codegen#973 suggesting this as the default behaviour.
The text was updated successfully, but these errors were encountered:
I was testing out
openapi-typescript-codegen
which seems like a really good & fast option to create a typescript client, but found a major hurdle.When generating clients from an OpenAPI spec, it's common to expose a service class with one method per endpoint. Usually you won't be able to create a class method containing the slashes in the request path (ex:
api/buyer/get
), so generators will use the optionaloperationId
andtags
fields to define method names.For example, in hulk the
/api/v1/buyer/create-buyer-branch
could be assigned{ tags: ["buyer"], operationId: "createBuyerBranch" }
so the resulting client looks like:Alternatively, an option to use the path itself as
operationId
in the output json would be enough to generate useful method names. I've opened an issue at ferdikoomen/openapi-typescript-codegen#973 suggesting this as the default behaviour.The text was updated successfully, but these errors were encountered: