jsonschema

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package jsonschema has functionality related to json schema support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema added in v0.1.2

type Schema struct {
	ID          string   `json:"$id,omitempty"`
	Schema      string   `json:"$schema,omitempty"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Type        Type     `json:"type"`
	Required    []string `json:"required"`
	// @todo make a recursive type of properties.
	Properties map[string]interface{} `json:"properties"`
}

Schema is a json schema definition. It doesn't implement all and may not comply fully. See https://json-schema.org/specification.html

type Type

type Type string

Type is a json schema type.

const (
	String      Type = "string"
	Number      Type = "number"
	Integer     Type = "integer"
	Boolean     Type = "boolean"
	Null        Type = "null"
	Object      Type = "object"
	Array       Type = "array"
	Unsupported Type = "UNSUPPORTED"
)

Json schema types.

func TypeFromString added in v0.1.2

func TypeFromString(t string) Type

TypeFromString creates a Type with enum validation.

func (*Type) UnmarshalYAML

func (t *Type) UnmarshalYAML(n *yaml.Node) (err error)

UnmarshalYAML implements yaml.Unmarshaler to parse Json Schema type.

Jump to

Keyboard shortcuts

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