Documentation
¶
Overview ¶
Customschema example: register Go types with goai.Register so that the generated spec carries fully fleshed-out request and response schemas, then drive validation constraints via the `goai:"..."` struct tag.
go run ./goai/examples/customschema
What this example shows:
- goai.Register links a (handler, method) pair to Go types that describe the request / response payloads.
- The `goai:"..."` struct tag adds OpenAPI metadata (description, example, format, validation constraints) to fields without forking the Go type definition.
- Functional options on goai.Register (WithSummary, WithTag, WithExample, WithExternalDocs, ...) shape the resulting Operation.
Click to show internal directories.
Click to hide internal directories.