Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidGtsID(s string) bool
- func ValidateInstanceModifiers(content map[string]any) error
- func ValidateSchemaModifiers(content map[string]any) error
- func ValidateTraitPlacement(content map[string]any) error
- type AttributeResult
- type CastResult
- type CompatibilityResult
- type EntityInfo
- type ExtractIDResult
- type GtsConfig
- type GtsFileReader
- type GtsID
- type GtsIDSegment
- type GtsReader
- type GtsReference
- type GtsStore
- func (s *GtsStore) BuildSchemaGraph(gtsID string) *SchemaGraphNode
- func (s *GtsStore) Cast(instanceID, toTypeID string) (*CastResult, error)
- func (s *GtsStore) CheckCompatibility(oldTypeID, newTypeID string) *CompatibilityResult
- func (s *GtsStore) Count() int
- func (s *GtsStore) Get(entityID string) *JsonEntity
- func (s *GtsStore) GetAttribute(gtsWithPath string) *AttributeResult
- func (s *GtsStore) GetSchemaContent(typeID string) (map[string]any, error)
- func (s *GtsStore) Items() map[string]*JsonEntity
- func (s *GtsStore) List(limit int) *ListResult
- func (s *GtsStore) Query(expr string, limit int) *QueryResult
- func (s *GtsStore) Register(entity *JsonEntity) error
- func (s *GtsStore) RegisterSchema(typeID string, schema map[string]any) error
- func (s *GtsStore) RegisterWithValidation(entity *JsonEntity, validate func(id string) error) error
- func (s *GtsStore) Unregister(entityID string)
- func (s *GtsStore) ValidateEntity(entityID string) *ValidateEntityResult
- func (s *GtsStore) ValidateInstance(instanceID string) *ValidationResult
- func (s *GtsStore) ValidateInstanceWithXGtsRef(instanceID string) error
- func (s *GtsStore) ValidateSchema(gtsID string) error
- func (s *GtsStore) ValidateSchemaChain(schemaID string) *ValidateSchemaChainResult
- func (s *GtsStore) ValidateSchemaTraits(schemaID string) *ValidateSchemaTraitsResult
- type IDValidationResult
- type InvalidGtsIDError
- type InvalidSegmentError
- type InvalidWildcardError
- type JsonEntity
- type JsonFile
- type ListResult
- type MatchIDResult
- type ParseIDResult
- type ParseIDSegment
- type QueryResult
- type RefValidationError
- type RefValidator
- type RegistryConfig
- type SchemaGraphNode
- type StoreGtsCastFromSchemaNotAllowedError
- type StoreGtsObjectNotFoundError
- type StoreGtsSchemaForInstanceNotFoundError
- type StoreGtsSchemaNotFoundError
- type UUIDResult
- type ValidateEntityResult
- type ValidateSchemaChainResult
- type ValidateSchemaTraitsResult
- type ValidationResult
- type XGtsRefValidationError
- type XGtsRefValidator
Constants ¶
const ( // GtsPrefix is the required prefix for all GTS identifiers GtsPrefix = "gts." // GtsURIPrefix is the URI-compatible prefix for GTS identifiers in JSON Schema $id field // (e.g., "gts://gts.x.y.z..."). This is ONLY used for JSON Schema serialization/deserialization, // not for GTS ID parsing. GtsURIPrefix = "gts://" // MaxIDLength is the maximum allowed length for a GTS identifier MaxIDLength = 1024 )
const ( KeyXGtsFinal = "x-gts-final" KeyXGtsAbstract = "x-gts-abstract" )
const KeyXGtsTraits = "x-gts-traits"
KeyXGtsTraits is the JSON Schema annotation keyword that supplies concrete values for trait properties declared via KeyXGtsTraitsSchema. Schema-only — MUST NOT appear in instances (see gts-spec §9.7.1).
const KeyXGtsTraitsSchema = "x-gts-traits-schema"
KeyXGtsTraitsSchema is the JSON Schema annotation keyword that defines the shape of trait properties available to a GTS type and its descendants. Schema-only — MUST NOT appear in instances (see gts-spec §9.7.1).
Variables ¶
var ( // ExcludeList contains directory names to exclude during file scanning ExcludeList = []string{"node_modules", "dist", "build"} )
var ( // GtsNamespace is the UUID namespace for GTS identifiers // Generated as uuid5(NAMESPACE_URL, "gts") GtsNamespace = uuid.NewSHA1(uuid.NameSpaceURL, []byte("gts")) )
Functions ¶
func IsValidGtsID ¶
IsValidGtsID checks if a string is a valid GTS identifier
func ValidateInstanceModifiers ¶ added in v0.12.0
ValidateInstanceModifiers checks that schema-only keywords (x-gts-final, x-gts-abstract, x-gts-traits-schema, x-gts-traits) do not appear anywhere in instance content. Per gts-spec §9.7.1 / §9.11.1 these annotations are only valid on JSON Schema (type-schema) documents and implementations MUST reject instances that contain them.
The check is recursive over both objects and arrays so a stray keyword nested under any property is also flagged.
func ValidateSchemaModifiers ¶ added in v0.12.0
ValidateSchemaModifiers checks that x-gts-final and x-gts-abstract are well-formed: boolean type, not both true, and not placed inside allOf entries at any depth.
func ValidateTraitPlacement ¶ added in v0.12.0
ValidateTraitPlacement enforces that x-gts-traits and x-gts-traits-schema appear only at the schema document top level (gts-spec §9.7.1/§9.11). Like the modifiers, these are type-level keywords; nesting either inside a subschema (allOf, properties, $defs/definitions, combinators, items, …) is a misplacement and is rejected (fail fast).
The rule constrains only the *position* of the keyword, not the *contents* of its value: the top-level x-gts-traits-schema is an ordinary JSON Schema subschema whose body may legitimately carry x-gts-* members (e.g. when an existing GTS type is reused as a trait-schema source via $ref). The top-level keyword values are therefore not re-scanned.
Types ¶
type AttributeResult ¶
type AttributeResult struct {
GtsID string `json:"gts_id"`
Path string `json:"path"`
Value any `json:"value,omitempty"`
Resolved bool `json:"resolved"`
Error string `json:"error,omitempty"`
AvailableFields []string `json:"available_fields,omitempty"`
}
AttributeResult represents the result of attribute path resolution
type CastResult ¶
type CastResult struct {
*CompatibilityResult
CastedEntity map[string]any `json:"casted_entity,omitempty"`
}
CastResult represents the result of casting an instance to a new schema version It extends CompatibilityResult with the casted entity
type CompatibilityResult ¶
type CompatibilityResult struct {
FromID string `json:"from"`
ToID string `json:"to"`
OldID string `json:"old"`
NewID string `json:"new"`
Direction string `json:"direction"`
AddedProperties []string `json:"added_properties"`
RemovedProperties []string `json:"removed_properties"`
ChangedProperties []map[string]string `json:"changed_properties"`
IsFullyCompatible bool `json:"is_fully_compatible"`
IsBackwardCompatible bool `json:"is_backward_compatible"`
IsForwardCompatible bool `json:"is_forward_compatible"`
IncompatibilityReasons []string `json:"incompatibility_reasons"`
BackwardErrors []string `json:"backward_errors"`
ForwardErrors []string `json:"forward_errors"`
Error string `json:"error,omitempty"`
}
CompatibilityResult represents the result of schema compatibility checking
type EntityInfo ¶
type EntityInfo struct {
ID string `json:"id"`
TypeID string `json:"type_id"`
IsTypeSchema bool `json:"is_type_schema"`
}
EntityInfo represents basic information about an entity
type ExtractIDResult ¶
type ExtractIDResult struct {
ID string `json:"id"`
TypeID *string `json:"type_id"`
SelectedEntityField *string `json:"selected_entity_field"`
SelectedTypeIDField *string `json:"selected_type_id_field"`
IsTypeSchema bool `json:"is_type_schema"`
}
ExtractIDResult holds the result of extracting ID information from JSON content
func ExtractGtsID ¶
func ExtractGtsID(content map[string]any, cfg *GtsConfig) *ExtractIDResult
ExtractGtsID extracts GTS ID from JSON content
type GtsConfig ¶
GtsConfig holds configuration for extracting GTS IDs from JSON content
func DefaultGtsConfig ¶
func DefaultGtsConfig() *GtsConfig
DefaultGtsConfig returns the default configuration for ID extraction
type GtsFileReader ¶
type GtsFileReader struct {
// contains filtered or unexported fields
}
GtsFileReader reads JSON entities from files and directories
func NewGtsFileReader ¶
func NewGtsFileReader(paths []string, cfg *GtsConfig) *GtsFileReader
NewGtsFileReader creates a new file reader with the given paths
func NewGtsFileReaderFromPath ¶
func NewGtsFileReaderFromPath(path string, cfg *GtsConfig) *GtsFileReader
NewGtsFileReaderFromPath creates a new file reader from a single path
func (*GtsFileReader) Next ¶
func (r *GtsFileReader) Next() *JsonEntity
Next returns the next JsonEntity or nil when exhausted
func (*GtsFileReader) ReadByID ¶
func (r *GtsFileReader) ReadByID(entityID string) *JsonEntity
ReadByID reads a JsonEntity by its ID For FileReader, this returns nil as we don't support random access by ID
func (*GtsFileReader) Reset ¶
func (r *GtsFileReader) Reset()
Reset resets the iterator to start from the beginning
type GtsID ¶
type GtsID struct {
ID string
Segments []*GtsIDSegment
}
GtsID represents a validated GTS identifier
func (*GtsID) IsWildcard ¶ added in v0.7.0
IsWildcard returns true if this identifier contains wildcard patterns
type GtsIDSegment ¶
type GtsIDSegment struct {
Num int
Offset int
Segment string
Vendor string
Package string
Namespace string
Type string
VerMajor int
VerMinor *int
IsType bool
IsWildcard bool
IsUUID bool
}
GtsIDSegment represents a parsed segment of a GTS identifier
type GtsReader ¶
type GtsReader interface {
// Next returns the next JsonEntity or nil when exhausted
Next() *JsonEntity
// ReadByID reads a JsonEntity by its ID
// Returns nil if the entity is not found
ReadByID(entityID string) *JsonEntity
// Reset resets the iterator to start from the beginning
Reset()
}
GtsReader is an interface for reading JSON entities from various sources
type GtsReference ¶
GtsReference represents a GTS ID reference found in JSON content
type GtsStore ¶
type GtsStore struct {
// contains filtered or unexported fields
}
GtsStore manages a collection of JSON entities and schemas with optional GTS reference validation.
mu serializes writers (Register, RegisterSchema, Unregister, RegisterWithValidation) so that snapshot/register/validate/rollback flows cannot interleave with other writers for the same id. Readers (Get, Items, List, Count, validators) intentionally do not acquire mu — validators are invoked via RegisterWithValidation while mu is already held by the same goroutine, so taking it again would deadlock.
func NewGtsStore ¶
NewGtsStore creates a new GtsStore, optionally populating it from a reader
func NewGtsStoreWithConfig ¶
func NewGtsStoreWithConfig(reader GtsReader, config *RegistryConfig) *GtsStore
NewGtsStoreWithConfig creates a new GtsStore with custom configuration
func (*GtsStore) BuildSchemaGraph ¶
func (s *GtsStore) BuildSchemaGraph(gtsID string) *SchemaGraphNode
BuildSchemaGraph recursively builds a relationship graph for a GTS entity This matches Python's build_schema_graph method in store.py
func (*GtsStore) Cast ¶
func (s *GtsStore) Cast(instanceID, toTypeID string) (*CastResult, error)
Cast transforms an instance to conform to a target schema version see gts-python store.py cast method
func (*GtsStore) CheckCompatibility ¶
func (s *GtsStore) CheckCompatibility(oldTypeID, newTypeID string) *CompatibilityResult
CheckCompatibility checks compatibility between two schemas see gts-python store.py is_minor_compatible method
func (*GtsStore) Get ¶
func (s *GtsStore) Get(entityID string) *JsonEntity
Get retrieves a JsonEntity by its ID If not found in cache, attempts to fetch from reader
func (*GtsStore) GetAttribute ¶
func (s *GtsStore) GetAttribute(gtsWithPath string) *AttributeResult
GetAttribute retrieves an attribute value from an entity using a path selector Format: "gts_id@path.to.field" or "gts_id@array[0].field" see gts-python ops.py attr method
func (*GtsStore) GetSchemaContent ¶
GetSchemaContent retrieves schema content as a map (legacy method)
func (*GtsStore) Items ¶
func (s *GtsStore) Items() map[string]*JsonEntity
Items returns all entity ID and entity pairs
func (*GtsStore) List ¶
func (s *GtsStore) List(limit int) *ListResult
List returns a list of entities up to the specified limit
func (*GtsStore) Query ¶
func (s *GtsStore) Query(expr string, limit int) *QueryResult
Query filters entities by a GTS query expression Supports: - Exact match: "gts.x.core.events.event.v1~" - Wildcard match: "gts.x.core.events.*" - With filters: "gts.x.core.events.event.v1~[status=active]" - Wildcard with filters: "gts.x.core.*[status=active]" - Wildcard filter values: "gts.x.core.*[status=active, category=*]" see gts-python store.py query method
func (*GtsStore) Register ¶
func (s *GtsStore) Register(entity *JsonEntity) error
Register adds a JsonEntity to the store with optional GTS reference validation.
func (*GtsStore) RegisterSchema ¶
RegisterSchema registers a schema with the given type ID This is a legacy method for backward compatibility
func (*GtsStore) RegisterWithValidation ¶ added in v0.12.0
func (s *GtsStore) RegisterWithValidation(entity *JsonEntity, validate func(id string) error) error
RegisterWithValidation atomically registers entity, runs validate, and rolls back on failure. The entire snapshot/register/validate/rollback critical section runs under s.mu, so concurrent writers for the same id cannot interleave between the snapshot and the rollback. validate is invoked while s.mu is held; it must not call back into the store's writer methods (Register, Unregister, RegisterSchema, RegisterWithValidation) or it will deadlock. Validators that only read the store are safe.
func (*GtsStore) Unregister ¶ added in v0.12.0
Unregister removes an entity from the store by its effective ID. Used to roll back registrations that fail post-register validation.
func (*GtsStore) ValidateEntity ¶ added in v0.12.0
func (s *GtsStore) ValidateEntity(entityID string) *ValidateEntityResult
ValidateEntity validates an entity by running both OP#12 (schema chain) and OP#13 (traits). The entity_id can be either a schema ID or an instance ID.
func (*GtsStore) ValidateInstance ¶
func (s *GtsStore) ValidateInstance(instanceID string) *ValidationResult
ValidateInstance validates an object instance against its schema. Accepts either a well-known GTS instance ID or an anonymous instance id (e.g. a UUID paired with a separate "type" field on the stored entity, spec §3.7). Returns ValidationResult with ok=true if validation succeeds.
func (*GtsStore) ValidateInstanceWithXGtsRef ¶
ValidateInstanceWithXGtsRef validates an instance against its schema including x-gts-ref constraints
func (*GtsStore) ValidateSchema ¶
ValidateSchema validates a schema including JSON Schema meta-schema and GTS reference validation
func (*GtsStore) ValidateSchemaChain ¶ added in v0.12.0
func (s *GtsStore) ValidateSchemaChain(schemaID string) *ValidateSchemaChainResult
ValidateSchemaChain validates each derived schema against its base across the chain (OP#12).
func (*GtsStore) ValidateSchemaTraits ¶ added in v0.12.0
func (s *GtsStore) ValidateSchemaTraits(schemaID string) *ValidateSchemaTraitsResult
ValidateSchemaTraits validates schema traits across the inheritance chain (OP#13). Walks the chain from base to leaf, collects x-gts-traits-schema and x-gts-traits from each level's raw content, then validates.
type IDValidationResult ¶
type IDValidationResult struct {
ID string `json:"id"`
Valid bool `json:"valid"`
IsType bool `json:"is_type"`
IsWildcard bool `json:"is_wildcard"`
Error string `json:"error,omitempty"`
}
IDValidationResult represents the result of GTS ID validation
func ValidateGtsID ¶
func ValidateGtsID(gtsID string) *IDValidationResult
ValidateGtsID validates a GTS identifier and returns a result
type InvalidGtsIDError ¶
InvalidGtsIDError represents an error when a GTS identifier is invalid
func (*InvalidGtsIDError) Error ¶
func (e *InvalidGtsIDError) Error() string
type InvalidSegmentError ¶
InvalidSegmentError represents an error in a specific segment
func (*InvalidSegmentError) Error ¶
func (e *InvalidSegmentError) Error() string
type InvalidWildcardError ¶
InvalidWildcardError represents an error when a wildcard pattern is invalid
func (*InvalidWildcardError) Error ¶
func (e *InvalidWildcardError) Error() string
type JsonEntity ¶
type JsonEntity struct {
GtsID *GtsID
TypeID string
SelectedEntityField string
SelectedTypeIDField string
IsTypeSchema bool
Content map[string]any
File *JsonFile
ListSequence *int
Label string
GtsRefs []*GtsReference // All GTS ID references found in content
}
JsonEntity represents a JSON object with extracted GTS identifiers
func NewJsonEntity ¶
func NewJsonEntity(content map[string]any, cfg *GtsConfig) *JsonEntity
NewJsonEntity creates a JsonEntity from JSON content using the provided config
func NewJsonEntityWithFile ¶
func NewJsonEntityWithFile(content map[string]any, cfg *GtsConfig, file *JsonFile, listSequence *int) *JsonEntity
NewJsonEntityWithFile creates a JsonEntity with file and sequence information
func (*JsonEntity) EffectiveID ¶ added in v0.12.0
func (e *JsonEntity) EffectiveID() string
EffectiveID returns the identifier used to key this entity in a registry and echo back to clients. Resolution order:
- Parsed GTS ID (schemas and well-known instances).
- Raw id field value for non-schemas (anonymous instances, spec §3.7) — used even when the schema reference cannot be resolved; schema presence is enforced at validation time, not at registration time.
- File path (+ list sequence for multi-entity files) when the entity originated from a file. Mirrors gts-rust.
Returns "" if none of the above apply.
type ListResult ¶
type ListResult struct {
Entities []EntityInfo `json:"entities"`
Count int `json:"count"`
Total int `json:"total"`
}
ListResult represents the result of listing entities
type MatchIDResult ¶
type MatchIDResult struct {
Candidate string `json:"candidate"`
Pattern string `json:"pattern"`
Match bool `json:"match"`
Error string `json:"error,omitempty"`
}
MatchIDResult represents the result of matching a GTS identifier against a pattern
func MatchIDPattern ¶
func MatchIDPattern(candidate, pattern string) MatchIDResult
MatchIDPattern matches a candidate GTS identifier against a pattern with wildcards Returns a MatchIDResult with Match=true if the candidate matches the pattern, or Match=false with an optional Error message on failure or mismatch
type ParseIDResult ¶
type ParseIDResult struct {
ID string `json:"id"`
OK bool `json:"ok"`
IsWildcard bool `json:"is_wildcard"`
IsType bool `json:"is_type"`
Segments []ParseIDSegment `json:"segments"`
Error string `json:"error,omitempty"`
}
ParseIDResult represents the result of parsing a GTS identifier
func ParseGtsID ¶
func ParseGtsID(gtsID string) ParseIDResult
ParseGtsID parses a GTS identifier into its components
func ParseID ¶
func ParseID(gtsID string) ParseIDResult
ParseID decomposes a GTS identifier into its constituent parts Returns a ParseIDResult with OK=true and populated Segments on success, or OK=false with an Error message on failure
type ParseIDSegment ¶
type ParseIDSegment struct {
Vendor string `json:"vendor"`
Package string `json:"package"`
Namespace string `json:"namespace"`
Type string `json:"type"`
VerMajor int `json:"ver_major"`
VerMinor *int `json:"ver_minor"`
IsType bool `json:"is_type"`
IsUUID bool `json:"is_uuid"`
}
ParseIDSegment represents a parsed segment component from a GTS identifier
type QueryResult ¶
type QueryResult struct {
Error string `json:"error"`
Count int `json:"count"`
Limit int `json:"limit"`
Results []map[string]any `json:"results"`
}
QueryResult represents the result of a GTS query execution
type RefValidationError ¶ added in v0.7.0
RefValidationError represents a validation error for $ref values
func (*RefValidationError) Error ¶ added in v0.7.0
func (e *RefValidationError) Error() string
type RefValidator ¶ added in v0.7.0
type RefValidator struct {
}
RefValidator validates $ref constraints in GTS schemas
func NewRefValidator ¶ added in v0.7.0
func NewRefValidator() *RefValidator
NewRefValidator creates a new $ref validator
func (*RefValidator) ValidateSchemaRefs ¶ added in v0.7.0
func (v *RefValidator) ValidateSchemaRefs(schema map[string]interface{}, schemaPath string) []*RefValidationError
ValidateSchemaRefs validates all $ref values in a schema
type RegistryConfig ¶
type RegistryConfig struct {
// ValidateGtsReferences enables validation of GTS references on entity registration
ValidateGtsReferences bool
}
RegistryConfig configures the GtsStore behavior
func DefaultRegistryConfig ¶
func DefaultRegistryConfig() *RegistryConfig
DefaultRegistryConfig returns the default registry configuration
type SchemaGraphNode ¶
type SchemaGraphNode struct {
ID string `json:"id"`
Refs map[string]*SchemaGraphNode `json:"refs,omitempty"`
TypeID *SchemaGraphNode `json:"type_id,omitempty"`
Errors []string `json:"errors,omitempty"`
}
SchemaGraphNode represents a node in the schema relationship graph
type StoreGtsCastFromSchemaNotAllowedError ¶
type StoreGtsCastFromSchemaNotAllowedError struct {
FromID string
}
StoreGtsCastFromSchemaNotAllowedError is returned when attempting to cast from a schema ID
func (*StoreGtsCastFromSchemaNotAllowedError) Error ¶
func (e *StoreGtsCastFromSchemaNotAllowedError) Error() string
type StoreGtsObjectNotFoundError ¶
type StoreGtsObjectNotFoundError struct {
EntityID string
}
StoreGtsObjectNotFoundError is returned when a GTS entity is not found in the store
func (*StoreGtsObjectNotFoundError) Error ¶
func (e *StoreGtsObjectNotFoundError) Error() string
type StoreGtsSchemaForInstanceNotFoundError ¶
type StoreGtsSchemaForInstanceNotFoundError struct {
EntityID string
}
StoreGtsSchemaForInstanceNotFoundError is returned when a schema ID cannot be determined for an instance
func (*StoreGtsSchemaForInstanceNotFoundError) Error ¶
func (e *StoreGtsSchemaForInstanceNotFoundError) Error() string
type StoreGtsSchemaNotFoundError ¶
type StoreGtsSchemaNotFoundError struct {
EntityID string
}
StoreGtsSchemaNotFoundError is returned when a GTS schema is not found in the store
func (*StoreGtsSchemaNotFoundError) Error ¶
func (e *StoreGtsSchemaNotFoundError) Error() string
type UUIDResult ¶
type UUIDResult struct {
ID string `json:"id"`
UUID string `json:"uuid"`
Error string `json:"error"`
}
UUIDResult represents the result of GTS ID to UUID conversion
type ValidateEntityResult ¶ added in v0.12.0
type ValidateEntityResult struct {
EntityID string `json:"entity_id"`
EntityType string `json:"entity_type"`
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
}
ValidateEntityResult is the result of OP#13 entity-level validation.
type ValidateSchemaChainResult ¶ added in v0.12.0
type ValidateSchemaChainResult struct {
TypeID string `json:"type_id"`
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
}
ValidateSchemaChainResult is the result of OP#12 schema chain validation.
type ValidateSchemaTraitsResult ¶ added in v0.12.0
type ValidateSchemaTraitsResult struct {
TypeID string `json:"type_id"`
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
}
ValidateSchemaTraitsResult is the result of OP#13 schema traits validation.
type ValidationResult ¶
type ValidationResult struct {
ID string `json:"id"`
OK bool `json:"ok"`
Error string `json:"error"`
}
ValidationResult represents the result of validating an instance
type XGtsRefValidationError ¶
type XGtsRefValidationError struct {
FieldPath string
Value interface{}
RefPattern string
Reason string
}
XGtsRefValidationError represents a validation error for x-gts-ref constraints
func (*XGtsRefValidationError) Error ¶
func (e *XGtsRefValidationError) Error() string
type XGtsRefValidator ¶
type XGtsRefValidator struct {
// contains filtered or unexported fields
}
XGtsRefValidator validates x-gts-ref constraints in GTS schemas
func NewXGtsRefValidator ¶
func NewXGtsRefValidator(store *GtsStore) *XGtsRefValidator
NewXGtsRefValidator creates a new x-gts-ref validator
func (*XGtsRefValidator) ValidateInstance ¶
func (v *XGtsRefValidator) ValidateInstance(instance map[string]interface{}, schema map[string]interface{}, instancePath string) []*XGtsRefValidationError
ValidateInstance validates an instance against x-gts-ref constraints in schema
func (*XGtsRefValidator) ValidateSchema ¶
func (v *XGtsRefValidator) ValidateSchema(schema map[string]interface{}, schemaPath string, rootSchema map[string]interface{}) []*XGtsRefValidationError
ValidateSchema validates x-gts-ref fields in a schema definition