openapi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CG

func CG(pkgDir string) ([]byte, error)

func CollectUndefined

func CollectUndefined(root *Node) []string

func PopulateDefaults

func PopulateDefaults(n *Node, y interface{}, aliases map[string]*Node)

func WriteGeneratedGoAndStub

func WriteGeneratedGoAndStub(root *Node, module string) (tmpdir, goFilePath string, err error)

func WriteValuesSchema

func WriteValuesSchema(crdBytes []byte, outPath string) error

Types

type Node

type Node struct {
	Name          string
	IsParam       bool
	TypeExpr      string
	Enums         []string
	DefaultVal    string
	HasDefaultVal bool // Set to true when DefaultVal is populated from YAML (even if empty)
	Comment       string
	OmitEmpty     bool
	Parent        *Node
	Child         map[string]*Node

	// Validation constraints
	Minimum          *float64
	Maximum          *float64
	ExclusiveMinimum bool
	ExclusiveMaximum bool
	MinLength        *int64
	MaxLength        *int64
	Pattern          string
	MinItems         *int64
	MaxItems         *int64
}

func Build

func Build(rows []Raw) *Node

type Raw

type Raw struct {
	K           kind
	Path        []string
	TypeExpr    string
	Enums       []string
	DefaultVal  string
	Description string
	OmitEmpty   bool // Field marked with [name] for omitempty

	// Validation constraints
	Minimum          *float64
	Maximum          *float64
	ExclusiveMinimum bool
	ExclusiveMaximum bool
	MinLength        *int64
	MaxLength        *int64
	Pattern          string
	MinItems         *int64
	MaxItems         *int64
}

func Parse

func Parse(file string) ([]Raw, error)

Jump to

Keyboard shortcuts

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