Documentation
¶
Overview ¶
Package bundlegen is the OpenAPI → bundle generator. It is deliberately a constrained, fail-loud subset: exactly one operation (single-version passthrough), request/response must be $ref'd component object schemas, scalars + arrays + $ref + nullable→proto3-optional are supported, and any unsupported construct (allOf/oneOf/anyOf/additionalProperties/untyped/ inline) is a hard error rather than a lossy bundle. Output is byte-reproducible (sorted, deterministic marshal) for the consumer's buf-breaking story.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶ added in v0.3.0
Add reads the OpenAPI doc from openapiSrc — a local file path or an http(s):// URL (fetched at build time; the bytes are passed through into the committed bundle, so a URL fetch stays point-in-time) — and emits a new immutable layer into bundleDir/<version>/, where <version> is the doc's info.version. It refuses to overwrite an existing layer: a frozen version is never rewritten.
func Remove ¶ added in v0.3.0
Remove hard-deletes a version's layer from bundleDir. It is oldest-only: version must be the lexically-oldest layer present, and at least one other layer must remain — the bundle is never emptied and the current version is never removed. Any other request is a hard error.
func Retire ¶ added in v0.3.0
Retire scaffolds a transform-shim override for version in bundleDir. It converts version from the default (direct-route) behaviour to a transform that chains to its immediate newer neighbour, leaving the request and response stanza arrays empty for a human to fill.
Hard errors:
- version is not a layer in bundleDir
- version is the newest layer (the current version is never retired)
- version already has an override in resolution.yaml
Any existing overrides for other versions are preserved verbatim. Operator comments in resolution.yaml are not preserved across the rewrite.
Types ¶
This section is empty.