Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDoctorCommand ¶
NewDoctorCommand creates the doctor command
func NewGenerateCommand ¶
NewGenerateCommand creates the generate command
func NewValidateCommand ¶
NewValidateCommand creates the validate command, which checks that an existing OpenAPI document (YAML or JSON) is structurally valid OpenAPI 3.0. It is the user-facing surface of the in-process validator that also backs the generator's --validate flag.
This validates the *document* only. Runtime request/response validation is out of scope.
func NewVersionCommand ¶
NewVersionCommand creates the version command
func ResolveVersion ¶
ResolveVersion picks the most authoritative version string available. Precedence: an ldflags-injected build version (GoReleaser / `make build`) wins; otherwise the main module version recorded by `go install`; otherwise the "dev" sentinel. injected is main.version, which defaults to "dev".
Pseudo-versions (e.g. "v0.0.0-20230101000000-abcdef123456") from a commit-pinned `go install` are treated as usable and returned as-is — they are the correct version for that build.
Types ¶
type DoctorOptions ¶
DoctorOptions holds options for the doctor command
type GenerateOptions ¶
type GenerateOptions struct {
ProjectRoot string
OutputFile string
Verbose bool
// Document metadata (override the analyzer defaults).
Title string
APIVersion string
Description string
Servers []string
License string
LicenseURL string
Format string // "yaml" (default) or "json"
DisableTenantAuth bool // omit the X-Tenant-ID security scheme (single-tenant)
TenantHeader string // header name for the tenant security scheme (default X-Tenant-ID)
Strict bool // treat warnings (empty/untyped) as a non-zero exit
Validate bool // validate the generated spec (OpenAPI 3.0) before writing
}
GenerateOptions holds options for the generate command