specfile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter loads a *published* OpenAPI document from a file on disk and exposes it through the same ir.Adapter contract as the code side. This is the document half of the symmetric "file -> IR" path.

func New

func New(path string) *Adapter

New returns a specfile Adapter bound to a path. The file is not read until Extract is called (IO is deferred, mirroring humaadapter's construction split).

func (*Adapter) Extract

func (a *Adapter) Extract(_ context.Context) (*ir.Document, error)

Extract implements ir.Adapter: a published file -> an OpenAPI 3.x Document.

KEY DIFFERENCE from the huma adapter: that one asserts 3.1 (huma only ever emits 3.1). This one accepts BOTH 3.0 and 3.1, because most specs published in the wild are still 3.0. It does NOT promote 3.0 -> 3.1 here; that normalization is the canonicalizer's job in the core, applied symmetrically to both sides right before diff. Version 2.0 is rejected explicitly (out of scope for now, on the roadmap).

Jump to

Keyboard shortcuts

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