schema_validator

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchemaIncompatibleWithType = errors.New("schema is incompatible with type")

Functions

This section is empty.

Types

type TypeSchemaValidator

type TypeSchemaValidator interface {
	// WithType immutably returns a new TypeSchemaValidator with the specified reflect.Type to validate.
	WithType(reflect.Type) TypeSchemaValidator
	// WithSchema immutably returns a new TypeSchemaValidator with the specified openapi3.Schema to validate.
	WithSchema(openapi3.Schema) TypeSchemaValidator
	// WithSchemaAndType immutably returns a new TypeSchemaValidator with the specified openapi3.Schema and reflect.Type to validate.
	WithSchemaAndType(openapi3.Schema, reflect.Type) TypeSchemaValidator
	// Validate reflect.Type and the openapi3.Schema compatibility using the validation Options.
	// Returns error with all compatability errors found or nil if compatible.
	Validate() error

	Errors() []string
	// contains filtered or unexported methods
}

TypeSchemaValidator helps validate reflect.Type and openapi3.Schema compatibility using the validation Options.

func NewEmptyTypeSchemaValidator

func NewEmptyTypeSchemaValidator() TypeSchemaValidator

NewEmptyTypeSchemaValidator returns a new TypeSchemaValidator that have no reflect.Type or openapi3.Schema configured yet.

func NewTypeSchemaValidator

func NewTypeSchemaValidator(goType reflect.Type, schema openapi3.Schema) TypeSchemaValidator

NewTypeSchemaValidator returns a new TypeSchemaValidator that helps validate reflect.Type and openapi3.Schema compatibility using the validation Options.

Jump to

Keyboard shortcuts

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