Documentation
¶
Overview ¶
Package emitter builds the final OpenAPI 3.1 document from merged operations and serializes it to YAML or JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build assembles a Document from routeOps. info.Title/Version populate the required Info object.
func Marshal ¶
Marshal serializes doc in the requested format. Both formats produce deterministic output — map-backed fields (Paths, Schemas, Responses...) come out with keys sorted alphabetically rather than in Go's randomized map iteration order.
func Validate ¶
Validate checks that doc is structurally valid OpenAPI, using kin-openapi as an independent authority rather than trusting our own struct definitions. It marshals doc to JSON internally — a format kin-openapi's loader handles unambiguously — so the check doesn't depend on which format the CLI eventually writes to disk.
Known limitation: kin-openapi v0.135.0 models the Schema Object per OpenAPI 3.0 (e.g. "nullable" and "exclusiveMinimum"/"exclusiveMaximum" as booleans, no "webhooks"/"jsonSchemaDialect" support). It still catches real structural mistakes — missing required fields, malformed $ref, wrong parameter/response shapes — but it is not a strict OpenAPI 3.1 conformance check. A newer kin-openapi (>= v0.140.0) fixes this properly but requires Go >= 1.25; revisit this once that's no longer a cost.