swagger-typescript-api
swagger-typescript-api copied to clipboard
Question about Axios template
Generated axios request template:

I have 2 different schemas for request and response:
Request schema: (id and color are optional to create this entity)
StageModel {
id?: number;
name: string;
color?: string;
...
...
}
Response schema: (no optional fields because I'm sure they will be presented in response and don't want typescript to complain like 'id' is possibly undefined in future use in my react components)
StageModelResponse {
id: number;
name: string;
color: string;
...
...
}
So the question is: can I generate different types and put them to axios request and response respectively? Or maybe I'm doing this all wrong and this can be achieved in more correct/elegant way? Someone help please! Thanks in advance 🙏