openapi

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package openapi renders the OpenAPI boundary from a lowered schema image and an optional compiled doc pack (RFC-001 §#080, issue #173).

It is a boundary renderer in the §#080 sense: the internal model is the image's protobuf carriers; JSON and YAML exist only in the final emission step. Responses are derived, never authored (GH #177); audience tiers are generator configuration, filtered at emission and never stripped from descriptors; x-since is derived from registry history or omitted.

Index

Constants

View Source
const ConfigFileName = "protowire.openapi.textproto"

ConfigFileName is the discovered generator-config file, a protowire.openapi.v1.GeneratorConfig in textproto form, looked up by upward walk from the image's directory — the same discovery shape protowire.config.textproto uses for the engine config.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// ImagePath is the lowered FileDescriptorSet from `pxf build`.
	ImagePath string
	// PackPath optionally names a compiled doc pack from `pxf docs build`.
	PackPath string
	// ConfigPath explicitly names the generator config; empty discovers
	// ConfigFileName upward from the image's directory.
	ConfigPath string
	// Audience is the emission tier ("public" … "internal"); empty
	// means public.
	Audience string
	// Format is "yaml" or "json".
	Format string
}

Options configures one generation run.

type Result

type Result struct {
	Document []byte
}

Result carries the rendered document.

func Generate

func Generate(opts Options) (*Result, error)

Generate runs the renderer.

Jump to

Keyboard shortcuts

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