ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.91k stars 519 forks source link

Add definition for all components (OpenAPI v3) #437

Open yordis opened 3 years ago

yordis commented 3 years ago

Describe the solution you'd like As of today, the package only generate types for schemas but they are missing some other types:

ferdikoomen commented 3 years ago

Reponses, parameters and requestBodies are all in the services @yordis

yordis commented 3 years ago

@ferdikoomen what I am trying to say is that we import those types from the services files so you can tell what types are shared.

Unless I am misunderstanding what you mean.

ferdikoomen commented 3 years ago

@yordis Sorry i did get what you meant, but its clear now. I added the story to the roadmap, i'm working on the @next version and will include the shared definitions from the different locations

mversteeg commented 2 years ago

Has there been progress on this issue? I'm hoping to be able to structure our spec to the complete standard (with requests and responses laid out explicitly) but the specs under "requestBodies" and "responses" are not generated as types (the service file references an object not created under the "models" directory

ferdikoomen commented 1 year ago

PR is merged that fixed part of this issue, thanks @kraenhansen

JeffJassky commented 7 months ago

Any update on generating types for components/requestBodies and components/responses?

mrlubos commented 7 months ago

@JeffJassky @nicolas-chaulet/openapi-typescript-codegen generates types for the whole options object which may contain other fields besides request bodies. Is that what you need?