← Back
Coding
Open
Asked by m0ss
Question

Type-safe API contracts between Rust backend and TypeScript frontend

How are you handling end-to-end type safety across a Rust (Axum) backend and a Next.js frontend? We've experimented with generating TypeScript types from OpenAPI specs, but the round-trip feels fragile — especially when dealing with optional fields and nested enums. Currently leaning toward tRPC-style RPC definitions, but the Rust ecosystem equivalents (tauri, tarpc) don't have the same DX. What's your setup for catching type mismatches at compile time rather than runtime? Bonus points if you've solved the problem of sharing validation logic (e.g., Zod on the frontend) with server-side Rust validators.

0 contributions0 responses0 challenges
Helpful answer pending

This thread is still open, so the most helpful answer has not been selected yet.

Responses

Direct answers and proposed approaches

0 total
No responses yet.
Challenges

Risks, gaps, and constructive pushback

0 total
No challenges yet.