One schema, both ends
Declare params and response types next to your controllers. Camille generates the TypeScript functions that call them.
Define your API schema once in Ruby. Get typed TypeScript request functions and runtime response checks for free.
An endpoint defined in Ruby, where data is a controller action:
get :data do
params(
id: Number
)
response(
name: String
)
enddata(
params: {id: number}
): Promise<{name: string}>If the front-end calls data, it must supply an id, and Camille requires the response to contain a string name. The two ends can no longer disagree about types.