openapi

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Schemas map[string]any `json:"schemas,omitempty"`
}

Components aggregates schema components.

type Document

type Document struct {
	OpenAPI    string         `json:"openapi"`
	Info       Info           `json:"info"`
	Paths      map[string]any `json:"paths,omitempty"`
	Components Components     `json:"components"`
	Extensions map[string]any `json:"-"`
}

Document represents a minimal OpenAPI document.

func NewDocument

func NewDocument(title, version string) *Document

NewDocument constructs a minimal OpenAPI document.

func (*Document) AddSchema

func (d *Document) AddSchema(name string, schema map[string]any)

AddSchema registers a component schema.

func (*Document) AsMap

func (d *Document) AsMap() map[string]any

AsMap returns the document as a map for registry consumers.

func (*Document) SetExtension

func (d *Document) SetExtension(key string, value any)

SetExtension sets a vendor extension on the document.

type Info

type Info struct {
	Title   string `json:"title"`
	Version string `json:"version"`
}

Info captures OpenAPI metadata.

Jump to

Keyboard shortcuts

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