Use CodeGen to generate Type Definitions for other languages (like Swift/Kotlin) #3608
pedroalonsoms
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
this would only make sense for API routes, right? a more scalable approach would be to generate Open API for which a lot of code gen tools exist |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I create an endpoint like this:
https://myapp.com/api/posts/user/123
Then TanStack router will generate the necessary type definitions to hit this endpoint in TypeScript.
Can we make it so that the type definitions are also generated/translated for Swift and Kotlin languages ?
This way, by creating the API's in TypeScript, we would be able to hit these endpoints for mobile apps as well (with type-safety).
gRPC does this in a similar way, except that it requires a
schema.proto
file, which is redundant if we already have the typescript definitions (we can just translate them to other languages)TypeScript (generated by TanStack)
Kotlin (translated)
Swift (translated)
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions