jsonschemautil

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDefAsSchema

func ExtractDefAsSchema(jsonSchema, defName string) (string, error)

ExtractDefAsSchema extracts a specific definition from the $defs property of JSON schema by its name. The resulting schema's $defs will contain any other definitions that are referenced by the extracted definition. It returns the definition as a JSON schema string.

func ExtractReferencedDefs

func ExtractReferencedDefs(jsonSchema, defName string) (map[string]any, error)

ExtractReferencedDefs extracts all definitions referenced by a specific definition in the $defs property of JSON schema. It returns a map of definition names to their corresponding JSON schema definitions. The resulting map will include the specified definition and any other definitions that are referenced by it.

func MustExtractDefAsSchema

func MustExtractDefAsSchema(jsonSchema, defName string) string

MustExtractDefAsSchema wraps ExtractDefAsSchema and panics if an error occurs.

func MustExtractReferencedDefs

func MustExtractReferencedDefs(jsonSchema, defName string) map[string]any

MustExtractReferencedDefs wraps ExtractReferencedDefs and panics if an error occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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