Module jsonschema.validator

sasindu/jsonschema.validator

0.1.0
Ballerina JSON Schema Validator

A lightweight Ballerina library for validating JSON values against JSON Schema (Draft 4+).

Key Features

Validate JSON against schemas programmatically.
Supports Draft 4+ schemas (with $id and modern keywords).
Simple API – Pass JSON + schema, get validation results.
Error Reporting – Detailed validation failures with paths.

Copy
import sasindu/jsonschema.validator as validator;  

json payload = { "name": "Ballerina", "version": "2201.7.0" };  
json schema = {  
    type: "object",  
    properties: {  
        name: { type: "string" },  
        version: { type: "string" }  
    }  
};  

error? result = validator:validate(payload, schema);  
if result is error {  
    // Handle validation failure
}

Import

import sasindu/jsonschema.validator;Copy

Metadata

Released date: 3 months ago

Version: 0.1.0


Compatibility

Platform: java21

Ballerina version: 2201.12.0


Pull count

Total: 3

Current verison: 3


Weekly downloads


Other versions

0.1.0