jsonschema

package
v0.0.0-...-eb49f3b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotImplemented is returned when the JSON schema encoding logic for a schema.FieldValidator has not (yet)
	// been implemented.
	ErrNotImplemented = errors.New("not implemented")
)

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	io.Writer
}

Encoder writes the JSON Schema representation of a schema.Schema to an output stream. Note that only a sub-set of the FieldValidator types in the schema package is supported at the moment. Custom validators are also not yet handled. Attempting to encode a schema containing such fields will result in a ErrNotImplemented error.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new JSONSchema Encoder that writes to w.

func (*Encoder) Encode

func (e *Encoder) Encode(s *schema.Schema) error

Encode writes the JSON Schema representation of s to the stream, followed by a newline character.

Jump to

Keyboard shortcuts

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