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.
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.
Click to show internal directories.
Click to hide internal directories.