draft07pb

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSchema

type JSONSchema struct {
	// $id defines a URI for the schema, and the base URI that other URI references within the schema are
	// resolved against.
	Id string `protobuf:"bytes,1,opt,name=id,json=$id,proto3" json:"id,omitempty"`
	// $schema keyword is both used as a JSON Schema version identifier and the location of a resource which
	// is itself a JSON Schema, which describes any schema written for this particular version.
	Schema string `protobuf:"bytes,2,opt,name=schema,json=$schema,proto3" json:"schema,omitempty"`
	// $ref keyword is used to reference a schema, and provides the ability to validate recursive structures
	// through self-reference.
	Ref string `protobuf:"bytes,3,opt,name=ref,json=$ref,proto3" json:"ref,omitempty"`
	// $comment keyword is reserved for comments from schema authors to readers or maintainers of the schema.
	// Implementations MUST NOT present this string to end users.
	Comment string `protobuf:"bytes,4,opt,name=comment,json=$comment,proto3" json:"comment,omitempty"`
	// title is a short string used to decorate a user interface with information.
	Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	// description will provide explanation about the purpose of the instance and is used to decorate a use interface with
	// information.
	Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	// default is used to supply a default JSON value associated with a particular schema. It is RECOMMENDED that a
	// default value be valid against the associated schema.
	Default *structpb.Value `protobuf:"bytes,7,opt,name=default,proto3" json:"default,omitempty"`
	// readOnly indicates that the value of the instance is managed exclusively by the owning authority, and attempts by
	// applications to modify the value of this property are expected to be ignored or rejected by that owning authority.
	ReadOnly bool `protobuf:"varint,8,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
	// examples keyword can be used to provide sample JSON values associated with a particular schema, for the purpose of
	// illustrating usage. It is RECOMMENDED that these values be valid against the associated schema.
	Examples []*structpb.Value `protobuf:"bytes,9,rep,name=examples,proto3" json:"examples,omitempty"`
	// minLength MUST be a non-negative integer. A string instance is valid against this keyword if its length is greater
	// than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its
	// characters as defined by RFC 7159.
	MinLength uint64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
	// items MUST be a valid JSON Schema. This keyword determines how child instances validate for arrays, and does not
	// directly validate the immediate instance itself. Validation succeeds if all elements in the array successfully
	// validate against that schema.
	Items *JSONSchema `protobuf:"bytes,19,opt,name=items,proto3" json:"items,omitempty"`
	// required members MUST be unique. An object instance is valid against this keyword if every item in the array is the
	// name of a property in the instance. Omitting this keyword has the same behavior as an empty array.
	Required []string `protobuf:"bytes,26,rep,name=required,proto3" json:"required,omitempty"`
	// properties MUST have a valid JSON Schema for each value. This keyword determines how child instances validate for
	// objects, and does not directly validate the immediate instance itself. Validation succeeds if, for each name that
	// appears in both the instance and as a name within this keyword's value, the child instance for that name
	// successfully validates against the corresponding schema. Omitting this keyword has the same behavior as an empty
	// object.
	Properties map[string]*JSONSchema `` /* 162-byte string literal not displayed */
	// type members MUST be unique. An instance validates if and only if the instance is in any of the sets listed for
	// this keyword.
	Type string `protobuf:"bytes,35,opt,name=type,proto3" json:"type,omitempty"`
	// allOf MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema. An instance validates
	// successfully against this keyword if it validates successfully against all schemas defined by this keyword's value.
	AllOf                []*JSONSchema `protobuf:"bytes,42,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

JSONSchema is an implementation of the JSONSchema draft-07 schema.

The related specifications can be found at https://json-schema.org/draft-07/json-schema-core.html and at https://json-schema.org/draft-07/json-schema-validation.html.

func (*JSONSchema) Descriptor

func (*JSONSchema) Descriptor() ([]byte, []int)

func (*JSONSchema) GetAllOf

func (m *JSONSchema) GetAllOf() []*JSONSchema

func (*JSONSchema) GetComment

func (m *JSONSchema) GetComment() string

func (*JSONSchema) GetDefault

func (m *JSONSchema) GetDefault() *structpb.Value

func (*JSONSchema) GetDescription

func (m *JSONSchema) GetDescription() string

func (*JSONSchema) GetExamples

func (m *JSONSchema) GetExamples() []*structpb.Value

func (*JSONSchema) GetId

func (m *JSONSchema) GetId() string

func (*JSONSchema) GetItems

func (m *JSONSchema) GetItems() *JSONSchema

func (*JSONSchema) GetMinLength

func (m *JSONSchema) GetMinLength() uint64

func (*JSONSchema) GetProperties

func (m *JSONSchema) GetProperties() map[string]*JSONSchema

func (*JSONSchema) GetReadOnly

func (m *JSONSchema) GetReadOnly() bool

func (*JSONSchema) GetRef

func (m *JSONSchema) GetRef() string

func (*JSONSchema) GetRequired

func (m *JSONSchema) GetRequired() []string

func (*JSONSchema) GetSchema

func (m *JSONSchema) GetSchema() string

func (*JSONSchema) GetTitle

func (m *JSONSchema) GetTitle() string

func (*JSONSchema) GetType

func (m *JSONSchema) GetType() string

func (*JSONSchema) ProtoMessage

func (*JSONSchema) ProtoMessage()

func (*JSONSchema) Reset

func (m *JSONSchema) Reset()

func (*JSONSchema) String

func (m *JSONSchema) String() string

func (*JSONSchema) XXX_DiscardUnknown

func (m *JSONSchema) XXX_DiscardUnknown()

func (*JSONSchema) XXX_Marshal

func (m *JSONSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JSONSchema) XXX_Merge

func (m *JSONSchema) XXX_Merge(src proto.Message)

func (*JSONSchema) XXX_Size

func (m *JSONSchema) XXX_Size() int

func (*JSONSchema) XXX_Unmarshal

func (m *JSONSchema) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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