examples/

directory
v1.15.12 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

Directories

Path Synopsis
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.
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.
Docstring example: generate OpenAPI metadata from namespaced handler doc-comment directives instead of goai.Register calls.
Docstring example: generate OpenAPI metadata from namespaced handler doc-comment directives instead of goai.Register calls.
Full example: drive RunCLI with the complete RunOptions surface so the generated YAML exercises every Document-level OpenAPI 3.0.3 feature goai supports — License, Contact, TermsOfService, ExternalDocs, multiple Servers with ServerVariables, multiple Tags, GlobalSecurity, SecuritySchemes, and a custom DefaultOutput path.
Full example: drive RunCLI with the complete RunOptions surface so the generated YAML exercises every Document-level OpenAPI 3.0.3 feature goai supports — License, Contact, TermsOfService, ExternalDocs, multiple Servers with ServerVariables, multiple Tags, GlobalSecurity, SecuritySchemes, and a custom DefaultOutput path.
Merge example: walk a route tree, generate a fresh spec, then layer it onto a hand-tuned `openapi.yaml` baseline using goai.Merge3Way.
Merge example: walk a route tree, generate a fresh spec, then layer it onto a hand-tuned `openapi.yaml` baseline using goai.Merge3Way.
Quickstart example: build a minimal route tree, walk it, and print the generated OpenAPI 3.0.3 YAML to stdout.
Quickstart example: build a minimal route tree, walk it, and print the generated OpenAPI 3.0.3 YAML to stdout.
Runtime example: serve the generated OpenAPI YAML at /openapi.yaml from inside a running gone HTTP server, instead of generating it ahead of time from a CLI.
Runtime example: serve the generated OpenAPI YAML at /openapi.yaml from inside a running gone HTTP server, instead of generating it ahead of time from a CLI.

Jump to

Keyboard shortcuts

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