nori/bundler

OpenAPI spec bundler — merges split YAML specs into a single file.

Takes a multi-file OpenAPI spec (using $ref to reference external files) and produces a single, self-contained YAML or Document output. Similar to redocly bundle.

Types

Errors from bundling.

pub type BundleError {
  ResolveError(types.RefError)
  DecodeError(message: String)
}

Constructors

  • ResolveError(types.RefError)

    A $ref resolution error occurred

  • DecodeError(message: String)

    The resolved spec could not be decoded into a Document

Values

pub fn bundle(entry_path: String) -> Result(String, BundleError)

Bundles a split OpenAPI spec into a single YAML string.

Loads the entry file, resolves all $ref pointers (loading external files as needed), and emits the fully-resolved spec as YAML.

Examples

let assert Ok(yaml_str) = bundler.bundle("./openapi/nori.yaml")
pub fn bundle_to_document(
  entry_path: String,
) -> Result(document.Document, BundleError)

Bundles a split OpenAPI spec and returns a typed Document.

Resolves all $ref pointers, then decodes the result into a Document.

Search Document