mapping

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Kebab(s string) string

Kebab exposes the tree's kebab-casing to render, so derived names (binary from title) case identically to command names.

func Map

func Map(doc *spec.Document, cfg *config.Config) *ir.API

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

func SchemeNames(cfg *config.Config) []string

SchemeNames lists every scheme a per-operation override may name, sorted.

func ValidatePagination

func ValidatePagination(cfg *config.Config) error

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.

Jump to

Keyboard shortcuts

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