Documentation
¶
Overview ¶
Package mapping builds the IR from a loaded spec. This phase is sequential by design: global ordering over sorted inputs is what guarantees byte-identical output regardless of scheduling (see PRD "Generation pipeline and concurrency model").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Kebab ¶
Kebab exposes the tree's kebab-casing to render, so derived names (binary from title) case identically to command names.
func Map ¶
Map converts a loaded spec into the sorted, normalized IR. cfg supplies the per-operation overrides (keyed by operationId or "METHOD /path", with in-spec x-biscuit-* extensions merging beneath them, sidecar winning field-wise) and any declared pagination schemes; a nil cfg means neither.
func SchemeNames ¶
SchemeNames lists every scheme a per-operation override may name, sorted.
func ValidatePagination ¶
ValidatePagination rejects a per-operation pagination override naming a scheme that does not exist. Shape validation of the schemes themselves happens in config.Load; this needs the built-in library to answer.
Types ¶
type Scheme ¶
type Scheme struct {
Name string
Declared bool // came from biscuit.yaml, so it outranks the built-in library
Type string // cursor | offset | page
Params []string // query params that advance a page
LimitParams []string // query params carrying the page size
RequireLimit bool // only match when a LimitParams member is present too
ItemsField string // response items path; empty infers the response's single array field
NextFields []string // response next-signal paths
NextKind string // has_more | cursor | url | link_header
// Corroborate lists offset/page fields accepted as the next-page signal
// when no NextFields member is present: a documented total says the
// response is a page of something, and the walk then steps arithmetically.
Corroborate []string
}
Scheme is one pagination convention. Built-ins carry alias lists — the same convention is spelled several ways in the wild — and a biscuit.yaml scheme produces the same struct with single-element lists. Within a list, order is preference: the first name the operation declares is the one the walk uses.