Hacker News new | ask | show | jobs
by spzb 944 days 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-re...

1 comments

TypeLite used to offer something similar, but it's somewhat dead nowadays.

OpenAPI client generators are probably what's popular today.

Yep. For frontend use, I think https://www.npmjs.com/package/openapi-typescript is the most widely-used/well-regarded, though 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/) 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.