A Go framework that turns your handler types into an OpenAPI 3.1 spec at runtime and a typed TypeScript client on every save.
npm create shiftapi@latesttype Greeting struct {
`json:"hello" `
SentAt time.Time `json:"sent_at"`
}
func greet(
r *http.Request, in *Person,
) (*Greeting, error) {
// ...
}
api.Handle("POST /greet", greet)export interface Greeting {
hello: string;
sent_at?: string;
}
const { data } = await client.POST(
"/greet", { body },
);
data.hello
// ^? stringRegistering a handler captures its input and output structs. Field tags say where each value is read from.
Those types become an OpenAPI 3.1 document served by the same process, so the spec cannot drift from the code.
The Vite or Next.js plugin fetches the spec and rewrites the client. Types update in your editor without a reload.
Validation tags, typed errors, file uploads, server-sent events, WebSockets, and a Scalar reference at /docs come along with it. The API is still an http.Handler, so your middleware and deployment stay the same. Read the docs for the rest.