Replies: 1 comment
-
imho T represents response type. Request doesn't need to be a generic type as it is passed only to a generated action method where it is transformed into
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Generated axios request template:

I have 2 different schemas for request and response:
Request schema: (id and color are optional to create this entity)
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)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 🙏
Beta Was this translation helpful? Give feedback.
All reactions