Article
· Nov 10 2m read

FastJsonSchema: Native High-Performance JSON Validation for IRIS

FastJsonSchema: High-Performance JSON Validation in IRIS

Validating JSON data against JSON Schema is a common requirement for modern applications. FastJsonSchema brings this capability natively to InterSystems IRIS, combining speed, simplicity, and full schema compliance.

Unlike traditional validation approaches, FastJsonSchema generates native ObjectScript code from your JSON Schemas and compiles it directly to iris object code, enabling idiomatic performance without relying on external libraries or runtimes.

Why Use FastJsonSchema?

  • Native IRIS Code Generation – Compile your JSON Schema directly into ObjectScript and object code for lightning-fast execution.
  • High Performance – Fine-grained optimizations provide significant speed improvements, especially for repeated validations.
  • Detailed Validation – Validate at the property level with full adherence to JSON Schema rules.
  • Simple API – Compile schemas and validate JSON in just a few lines of code.
  • No External Dependencies – 100% native; no Python, Java, or other runtimes required.
  • Reusable Precompiled Schemas – Compile once, validate many times, reducing runtime overhead.

Supported JSON Schema Drafts

  • Draft-07

Getting Started

Compile a JSON Schema into native code:

Set sc = ##class(FastJsonSchema.Core).Compile(schema, schemaName)

Validate JSON data against a compiled schema:

Set sc = ##class(FastJsonSchema.Core).Validate(schemaName, pJSON)

Performance Tips

  • Compile Once, Use Many Times – Precompile schemas to object code to maximize speed.
  • Use Granular Schemas – Breaking complex JSON objects into smaller schemas improves validation efficiency.
  • Handle Exceptions Gracefully – Catch to manage invalid JSON cleanly.

With FastJsonSchema, Achieve the perfect balance of performance and flexibility — validating JSON data natively, efficiently, and with confidence.

Discussion (1)1
Log in or sign up to continue