openapi

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package openapi exposes the embedded OpenAPI spec for runtime documentation lookups, e.g., the `cub <entity> explain` commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	Description          string             `yaml:"description"`
	Type                 string             `yaml:"type"`
	Format               string             `yaml:"format"`
	Enum                 []string           `yaml:"enum"`
	Properties           map[string]*Schema `yaml:"properties"`
	Items                *Schema            `yaml:"items"`
	AdditionalProperties *Schema            `yaml:"additionalProperties"`
	Ref                  string             `yaml:"$ref"`
	ReadOnly             bool               `yaml:"readOnly"`
	Nullable             bool               `yaml:"nullable"`
	Required             []string           `yaml:"required"`
	Pattern              string             `yaml:"pattern"`
	Example              any                `yaml:"example"`
}

Schema is a minimal projection of an OpenAPI schema, sufficient for surfacing human-readable property documentation.

func LookupSchema

func LookupSchema(name string) (*Schema, error)

LookupSchema returns the named top-level schema from the embedded OpenAPI spec. The error indicates either a parse failure or an unknown schema name.

func (*Schema) PropertyNames

func (s *Schema) PropertyNames() []string

PropertyNames returns the names of a schema's properties in sorted order.

func (*Schema) RefName

func (s *Schema) RefName() string

RefName returns the last segment of a $ref pointer (e.g., "#/components/schemas/UpdateType" -> "UpdateType"), or "" if the schema is not a reference.

Directories

Path Synopsis
Package goclientnew provides primitives to interact with the openapi HTTP API.
Package goclientnew provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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