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
port sasindu/jsonschema.validator as validator;  

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

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

Import

import sasindu/jsonschema.validator;Copy

Metadata

Released date: 7 days ago

Version: 0.1.0


Compatibility

Platform: java21

Ballerina version: 2201.12.0


Pull count

Total: 2

Current verison: 2


Weekly downloads


Other versions

0.1.0