docstring

command
v1.15.17 Latest Latest
Warning

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

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

Documentation

Overview

Docstring example: generate OpenAPI metadata from namespaced handler doc-comment directives instead of goai.Register calls.

go run ./goai/examples/docstring

What this example shows:

  • Handler struct comments can provide shared operation metadata.
  • Handler method comments provide endpoint-specific metadata.
  • Only `@goai.*` lines flow into OpenAPI; ordinary Go comments stay private to source readers.
  • `schemaType=SomeStruct` and `schemaType=packageAlias.SomeStruct` resolve Go structs into components.schemas and use $ref from operations.

Jump to

Keyboard shortcuts

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