SchemaUtils
SchemaUtils validates SWML documents against structural rules and provides
schema-driven verb extraction and validation. Results are cached with an
LRU-style eviction policy. Set SWML_SKIP_SCHEMA_VALIDATION=true to disable
validation globally.
Constructor
opts
Optional constructor configuration.
opts.skipValidation
Skip all validation checks. When omitted, defaults to true if the
SWML_SKIP_SCHEMA_VALIDATION environment variable is "true", otherwise false.
opts.maxCacheSize
Maximum number of cached validation results before LRU eviction.
opts.schemaPath
Path to a custom JSON Schema file. When omitted, the bundled schema.json
is used. Mirrors the Python SDK’s schema_path parameter. A load failure
falls back to the bundled schema silently.
Methods
Get all verb names defined in the SWML schema.
Get the inner properties schema for a specific verb.
Get the required properties for a verb.
Get the description text for a verb.
Check if a verb name exists in the schema.
Lightweight validation of a verb config against the schema.
Validate a SWML document against structural rules.
Clear the validation result cache.
Get the number of cached validation results.