Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GetUserInput ¶
type GetUserInput struct {
ID string `path:"id" doc:"ID of the user to fetch"` // doc -> description (the prose aspect)
}
GetUserInput declares what the request accepts. path:"id" -> a required path parameter in OpenAPI.
type GetUserOutput ¶
type GetUserOutput struct {
Body User
}
GetUserOutput: the type in the Body field becomes the 200 response schema. huma convention: the top-level Body field is the response body.
type User ¶
type User struct {
UserID string `json:"userId"` // exposed as "userId"; renaming changes the contract
Email string `json:"email" format:"email"` // format:"email" is emitted as a schema constraint
}
User becomes components/schemas/User in the emitted spec. The struct tags here ARE the contract — drift is detected against them.
Click to show internal directories.
Click to hide internal directories.