3 ms·
I enjoyed using ServiceStack. Write your data model in the C# API, run a tiny CLI command and it spits out Typescript definitions to match your data model. htt
by spzb 3y ago
I enjoyed using ServiceStack. Write your data model in the C# API, run a tiny CLI command and it spits out Typescript definitions to match your data model.
https://docs.servicestack.net/typescript-add-servicestack-reference https://docs.servicestack.net/typescript-add-servicestack-re...
- fuzzy2 3y agoTypeLite used to offer something similar, but it's somewhat dead nowadays. OpenAPI client generators are probably what's popular today.
- rattray 3y agoYep. For frontend use, I think https://www.npmjs.com/package/openapi-typescript https://www.npmjs.com/package/openapi-typescript is the most widely-used/well-regarded, though https://www.npmjs.com/package/orval https://www.npmjs.com/package/orval seems to me to have some nicer features like react-query support. There are other options too, I'd just stay away from "_the_ openapi generator" (https://openapi-generator.tech/ https://openapi-generator.tech/) which does a pretty poor job IMO. Disclaimer: I'm the founder of a company doing SDKs commercially, but we don't focus on the frontend right now, and our free plan is still in beta.