Parody. Words were added by a robot, not by Mr. Jackson or the site you're reading. Don't log into sh*t through here.
A motherf*ckin' Go framework that turns your handler types into an OpenAPI 3.1 spec at runtime and a typed TypeScript client on every save, believe that.
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 goddamn handler captures its input and output structs. Field tags say where each value is read from.
Those muthaf*ckin' types become an OpenAPI 3.1 document served by the same process, so the spec cannot drift from the motherf*ckin' code.
The Vite or Next.js plugin fetches the spec and rewrites the client. I ain't playin'. Types update in your editor without a muthaf*ckin' reload. Hell yeah.
Validation tags, typed errors, file uploads, server-sent events, WebSockets, and a muthaf*ckin' 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 motherf*ckin' docs for the damn rest.