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've just started using this library and I'm a bit confused about the response type. Is it correct that I need to add a response type schema to each hook manually?
Would it generally be possible to infer the response schema from the type information in the elysia object like it's done in eden treaty or am I missing some conceptual differences here?
This would be super useful.
The text was updated successfully, but these errors were encountered:
Thank you for answering my question and sorry for the late reply. I see that this is making inference of response types impossible currently.
Nevertheless, having correct documentation of the response for apis that don't explicitly describe the response would be super nice. An app of a customer for instance uses drizzle and eden treaty and therefore profits from end to end type safety. But the swagger docs don't reflect that and it's also not possible to generate api clients for other languages over the openapi spec (would be great for the mobile app).
I think that there should be some kind of CLI included with this package that can be used to generate a json file that contains the missing type information for the response schema so that this can then be used at runtime. I've already played around with the TS compiler APIs and I think that an approach would be totally feasible. Additionally this can be a purely optional thing in the library.
Please let me know what you think about it and if something like this could be merged into the library if I came up with the code.
Hi!
I've just started using this library and I'm a bit confused about the response type. Is it correct that I need to add a response type schema to each hook manually?
Would it generally be possible to infer the response schema from the type information in the elysia object like it's done in eden treaty or am I missing some conceptual differences here?
This would be super useful.
The text was updated successfully, but these errors were encountered: