jsonschema

package
v0.19.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FullTree          bool
	EnumInDescription bool // Keep {val1,val2,...} patterns in description fields
}

Config holds the resolved configuration for JSONSchema.

func Apply

func Apply(opts ...Opt) *Config

Apply applies all options to a Config and returns it.

type Opt

type Opt func(*Config)

Opt is a functional option for JSONSchema.

func WithEnumInDescription

func WithEnumInDescription() Opt

WithEnumInDescription preserves {val1,val2,...} patterns in description fields.

By default, enum patterns are stripped from descriptions since the values are already available in the enum array. This produces cleaner output for machine consumers. Use this option to keep the original description text intact.

func WithFullTree

func WithFullTree() Opt

WithFullTree makes JSONSchema walk the entire command tree depth-first, returning a schema for every available command.

type Options

type Options struct {
	FlagName string // Name of the persistent flag (defaults to "jsonschema")

	// SchemaOpts configures the schema renderer used by SetupJSONSchema.
	// It accepts the same functional options as JSONSchema().
	SchemaOpts []Opt
}

Options configures the --jsonschema flag for command-line applications.

Jump to

Keyboard shortcuts

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