customschema

command
v1.15.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL