specbundle

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package specbundle turns the studio's split OpenAPI document into the single self-contained file the docs surface serves (spec 0053 §3).

The document is split across api/openapi.yaml, api/components.yaml and api/paths/*.yaml because it outgrew one file, and both generators resolve that split themselves. A browser cannot: Stoplight fetches one URL and resolves relative refs against it, so `../components.yaml#/...` would be requested from the server root and 404. Serving the tree instead would mean hand-written routes for files that are not an API surface, so the document is bundled once at generate time and served as one blob.

COMPOSED rather than inlined. Composing hoists the shared schemas into #/components and rewrites refs to point there, which is what makes Stoplight render named models; inlining produces a 529 KB document of anonymous duplicates that is correct and unreadable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bundle

func Bundle(root []byte, basePath string) ([]byte, error)

Bundle takes the root document and the directory its relative references are written against, and returns one document with every external reference resolved into it. It reads no file itself, which keeps the resolution rules in one place and the test free of a fixture tree.

Remote references are refused: a document that reaches the network to build is one that builds differently on a bad day.

Types

This section is empty.

Directories

Path Synopsis
cmd
specbundle command
Command specbundle writes the studio's bundled OpenAPI document.
Command specbundle writes the studio's bundled OpenAPI document.

Jump to

Keyboard shortcuts

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