Documentation
¶
Overview ¶
Package schema defines a deliberately bounded schema vocabulary for plugin payloads and configuration. It is not a complete JSON Schema implementation.
Index ¶
Constants ¶
const Version = "ext.schema/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct {
Type string `json:"type"`
Properties map[string]Schema `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
AdditionalProperties bool `json:"additionalProperties,omitempty"`
Items *Schema `json:"items,omitempty"`
Enum []string `json:"enum,omitempty"`
Minimum *float64 `json:"minimum,omitempty"`
Maximum *float64 `json:"maximum,omitempty"`
MinLength int `json:"minLength,omitempty"`
MaxLength int `json:"maxLength,omitempty"`
MinItems int `json:"minItems,omitempty"`
MaxItems int `json:"maxItems,omitempty"`
}
Schema rejects undeclared object properties by default. Types are object, array, string, number, integer, boolean and null. Constraints inappropriate for a type are rejected. Optional fields may be absent; null is a distinct type.
func (Schema) Check ¶
func (s Schema) Check(data json.RawMessage) error
Check validates JSON without including payload values in errors.