jsonschema

package
v0.47.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendMapToJsonSchema added in v0.44.0

func AppendMapToJsonSchema(baseConfig interface{}, mapConfig map[string]interface{}) *jschema.Schema

AppendMapToJsonSchema generates a jsonschema based on a baseConfig and then append a map of properties using the mapConfig.

func AppendOneOfToJsonSchema added in v0.44.0

func AppendOneOfToJsonSchema(baseConfig interface{}, anyOf map[string]interface{}) *jschema.Schema

AppendOneOfToJsonschema generates a jsonschema based on a baseConfig and then append a oneOf based on the mapConfig.

func CleanCommentDirectory

func CleanCommentDirectory() error

CleanCommentDirectory will remove the main temporary directory used by updatecli.

func CloneCommentDirectory

func CloneCommentDirectory() error

CloneCommentDirectory clones the updatecli git repository in a temporary location so we can parse comments

func GetPackageComments

func GetPackageComments(rootPackagePath string) (map[string]string, error)

GetPackageComments retrieves all updatecli code comments

Types

type Schema

type Schema struct {
	SchemaDir    string
	BaseSchemaID string
	JsonSchema   jschema.Schema
}

func New

func New(baseSchemaID, schemaDirectory string) *Schema

func (*Schema) GenerateSchema

func (s *Schema) GenerateSchema(object interface{}) error

GenerateSchema generates updatecli json schema based the config struct

func (*Schema) Save

func (s *Schema) Save() error

Save export a jsonschema to a local file

func (*Schema) String

func (s *Schema) String() string

String implements the string interface

Jump to

Keyboard shortcuts

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