tRPC client from swagger

I have a backend that is written using FastAPI, and it is already quite large and utilizes unique technologies. I would like to use tRPC in my create-t3-app, but I haven't been able to find a solution for generating a tRPC client from a swagger API through my research. I am unsure if this is even possible. I would greatly appreciate any help or suggestions on how to proceed.
8 Replies
Samathingamajig
Due to the nature of it i dont think an automatic generator can be made (without a huge amount of time to create it) it should be pretty easy to manually convert it though how "quite large" is it?
Yatochka
Yatochka2y ago
About 80-100 endpoints So rewriting every endpoint and calling fetch(...) inside of it would take quite long.
Samathingamajig
are the swagger endpoints already typed? (like what the inputs are, what the outputs are; i'm not asking if you've typed them on a keyboard lol)
Yatochka
Yatochka2y ago
wdym?
Samathingamajig
a trpc endpoint needs to know what types the inputs are, and what type the output is does that information already exist on the swagger endpoints?
Yatochka
Yatochka2y ago
Yes
Yatochka
Yatochka2y ago
Example:
Yatochka
Yatochka2y ago
In json it looks like this:
Want results from more Discord servers?
Add your server