schema

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypesRootDir = "types"

	CommonSchema     FileName = "common/schema.yaml"
	WorkspaceSchema  FileName = "workspace/schema.yaml"
	ConfigSchema     FileName = "config/schema.yaml"
	ExecutableSchema FileName = "executable/executable_schema.yaml"
	FlowfileSchema   FileName = "executable/flowfile_schema.yaml"

	CommonDefinitionTitle     = "Common"
	WorkspaceDefinitionTitle  = "Workspace"
	ConfigDefinitionTitle     = "Config"
	ExecutableDefinitionTitle = "Executable"
	FlowfileDefinitionTitle   = "FlowFile"
)

Variables

Functions

func FieldCase

func FieldCase(s string) string

func MergeSchemas

func MergeSchemas(dst, src *JSONSchema, dstFile FileName, schemaMap map[FileName]*JSONSchema)

func RegisteredSchemaMap

func RegisteredSchemaMap() map[FileName]*JSONSchema

func TitleCase

func TitleCase(s string) string

Types

type FieldKey

type FieldKey string

func (FieldKey) Lower

func (f FieldKey) Lower() string

func (FieldKey) String

func (f FieldKey) String() string

func (FieldKey) Title

func (f FieldKey) Title() string

type FileName

type FileName string

func (FileName) JSONSchemaFile

func (s FileName) JSONSchemaFile() string

func (FileName) MarkdownFile

func (s FileName) MarkdownFile() string

func (FileName) String

func (s FileName) String() string

func (FileName) Title

func (s FileName) Title() string

type JSONSchema

type JSONSchema struct {
	Schema               string                   `json:"$schema,omitempty"              yaml:"$schema,omitempty"`
	Ref                  Ref                      `json:"$ref,omitempty"                 yaml:"$ref,omitempty"`
	ID                   string                   `json:"$id,omitempty"                  yaml:"$id,omitempty"`
	Description          string                   `json:"description,omitempty"          yaml:"description,omitempty"`
	Type                 string                   `json:"type,omitempty"                 yaml:"type,omitempty"`
	Required             []string                 `json:"required,omitempty"             yaml:"required,omitempty"`
	Default              interface{}              `json:"default,omitempty"              yaml:"default,omitempty"`
	Enum                 []string                 `json:"enum,omitempty"                 yaml:"enum,omitempty"`
	Definitions          map[FieldKey]*JSONSchema `json:"definitions,omitempty"          yaml:"definitions,omitempty"`
	Properties           map[FieldKey]*JSONSchema `json:"properties,omitempty"           yaml:"properties,omitempty"`
	AdditionalProperties *JSONSchema              `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"`
	Items                *JSONSchema              `json:"items,omitempty"                yaml:"items,omitempty"`
	Ext                  SchemaExt                `json:"-"                              yaml:"goJSONSchema,omitempty"`
}

type Ref

type Ref string

func (Ref) DefinitionPath

func (s Ref) DefinitionPath() string

func (Ref) ExternalFile

func (s Ref) ExternalFile() FileName

func (Ref) Key

func (s Ref) Key() FieldKey

func (Ref) String

func (s Ref) String() string

type SchemaExt

type SchemaExt struct {
	Type       string `json:"-" yaml:"type"`
	Identifier string `json:"-" yaml:"identifier"`
}

func (SchemaExt) IsExported

func (e SchemaExt) IsExported() bool

Jump to

Keyboard shortcuts

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