๐ŸŒ
Rust
docs.rs โ€บ jsonschema
jsonschema - Rust
For simple use cases where you need to validate an instance against a schema once, use is_valid or validate functions: use serde_json::json; let schema = json!({"type": "string"}); let instance = json!("Hello, world!"); assert!(jsonschema::is_valid(&schema, &instance)); assert!(jsonschema:...
๐ŸŒ
JSON Schema Validator
jsonschemavalidator.net
JSON Schema Validator - Newtonsoft
This schema validator is built using Json.NET Schema and C#. public class JsonSchemaController : ControllerBase { [HttpPost] [Route("api/jsonschema/validate")] public ValidateResponse Validate(ValidateRequest request) { // Load schema JSchema schema = JSchema.Parse(request.Schema); JToken json = JToken.Parse(request.Json); // Validate json IList<ValidationError> errors; bool valid = json.IsValid(schema, out errors); // Return error messages and line info to the browser return new ValidateResponse { Valid = valid, Errors = errors }; } } public class ValidateRequest { public string Json { get; set; } public string Schema { get; set; } } public class ValidateResponse { public bool Valid { get; set; } public IList<ValidationError> Errors { get; set; } }
๐ŸŒ
JSONLint
jsonlint.com โ€บ json-schema
JSON Schema Validator - Validate JSON Against Schema | JSONLint | JSONLint
Validate your JSON data against a JSON Schema. Catch structural errors, type mismatches, and missing required fields before they cause bugs.
๐ŸŒ
Readthedocs
python-jsonschema.readthedocs.io โ€บ en โ€บ v4.8.0 โ€บ validate
Schema Validation - jsonschema 4.8.0 documentation
It is assumed to be valid, and providing an invalid schema can lead to undefined behavior. See Validator.check_schema to validate a schema first. resolver โ€“ an instance of jsonschema.RefResolver that will be used to resolve $ref properties (JSON references).
๐ŸŒ
Jsonschema
jsonschema.dev
JSON Schema Validation
JSON Schema Validation, in browser, using ajv, with linting, and shareable schemas
๐ŸŒ
json-everything
docs.json-everything.net โ€บ schema โ€บ basics
JsonSchema.Net Basics | json-everything
2 days ago - JsonSchema.Net implements keywords using singleton keyword handlers. These handlers are responsible for validating that the keyword data is valid in the schema, building any subschemas, and instance evaluation.
๐ŸŒ
jsonschema
python-jsonschema.readthedocs.io โ€บ en โ€บ latest โ€บ validate
Schema Validation - jsonschema 4.26.1.dev25+gad0a1b301 documentation
The Basics: The simplest way to validate an instance under a given schema is to use the validate function. The Validator Protocol: jsonschema defines a protocol that all validator classes adhere to...
๐ŸŒ
JSON Schema
json-schema.org โ€บ understanding-json-schema โ€บ reference โ€บ conditionals
JSON Schema - Conditional schema validation
In this example, "country" is not a required property. Because the if schema also doesn't require the "country" property, it will pass and the "then" schema will apply. Therefore, if the "country" property is not defined, the default behavior is to validate "postal_code" as a USA postal code.
Find elsewhere
๐ŸŒ
JSON Schema
json-schema.org
JSON Schema
Establish a common language for data exchange, no matter the scale or complexity of your project. Define precise validation rules for your data structures to create shared understanding and increase interoperability across different systems and platforms.
๐ŸŒ
jsonschema
python-jsonschema.readthedocs.io โ€บ en โ€บ stable โ€บ validate
Schema Validation - jsonschema 4.26.0 documentation
The Basics: The simplest way to validate an instance under a given schema is to use the validate function. The Validator Protocol: jsonschema defines a protocol that all validator classes adhere to...
๐ŸŒ
jsonschema
python-jsonschema.readthedocs.io โ€บ en โ€บ latest โ€บ errors
Handling Validation Errors - jsonschema 4.26.1.dev25+gad0a1b301 documentation
Each tree and child has a ErrorTree.errors attribute, a dict, that maps the failed validation keyword to the corresponding validation error. The best_match function is a simple but useful function for attempting to guess the most relevant error in a given bunch. >>> from jsonschema import Draft202012Validator >>> from jsonschema.exceptions import best_match >>> schema = { ...
๐ŸŒ
Meziantou's blog
meziantou.net โ€บ json-schema-validation-in-dotnet.htm
Json schema validation in .NET - Meziantou's blog
April 1, 2024 - In this post, I describe how to validate JSON data against a JSON schema in .NET.
๐ŸŒ
GitHub
github.com โ€บ kaptinlin โ€บ jsonschema
kaptinlin/jsonschema: A powerful Go JSON Schema ...
Formats: Built-in validators for email, UUID, datetime, URI, etc. Registration: Register schemas for reuse and cross-references ... type User struct { Name string `jsonschema:"required,minLength=2,maxLength=50"` Email string `jsonschema:"required,format=email"` Age int `jsonschema:"minimum=18,maximum=120"` } // Generate schema from struct tags schema, err := jsonschema.FromStruct[User]() if err != nil { panic(err) } result := schema.Validate(userData)
Starred by 216 users
Forked by 23 users
Languages ย  Go
๐ŸŒ
Mockoon
mockoon.com โ€บ tools โ€บ json-schema-validator
Mockoon - Online JSON Schema validator
To use this tool, paste your JSON schema in the left editor and your JSON data in the right editor. The tool will automatically validate your JSON data against the schema and display any errors.
๐ŸŒ
GitHub
github.com โ€บ sourcemeta โ€บ jsonschema
GitHub - sourcemeta/jsonschema: The CLI for working with JSON Schema. Covers formatting, linting, testing, bundling, and more for both local development and CI/CD pipelines ยท GitHub
curl -fsSL https://raw.githubusercontent.com/sourcemeta/jsonschema/main/install -H 'Cache-Control: no-cache, no-store, must-revalidate' | /bin/sh
Starred by 250 users
Forked by 30 users
Languages ย  Shell 76.6% | C++ 17.9% | CMake 4.8% | JavaScript 0.5% | Makefile 0.1% | Dockerfile 0.1%
๐ŸŒ
Built In
builtin.com โ€บ software-engineering-perspectives โ€บ python-json-schema
How to Use JSON Schema to Validate JSON Documents in Python | Built In
Incorrect data types or missing some required fields will trigger the ValidationError. However, it should be noted that by default additional fields are allowed, which may or may not be what you want. If you want a strict schema and only allow fields that are defined by the properties keyword, you can specify the additionalProperties to be False: from jsonschema import validate schema = { "type": "object", "properties": { "name": {"type": "string"}, "age": {"type": "number"}, }, "required": ["name"], "additionalProperties": False } validate(instance={"name": "John", "age": 30, "job": "Engineer"}, schema=schema) # ValidationError: Additional properties are not allowed ('job' was unexpected)
๐ŸŒ
GitHub
github.com โ€บ Stranger6667 โ€บ jsonschema
GitHub - Stranger6667/jsonschema: A high-performance JSON Schema validator for Rust ยท GitHub
use serde_json::json; fn main() -> Result<(), Box<dyn std::error::Error>> { let schema = json!({"maxLength": 5}); let instance = json!("foo"); // One-off validation assert!(jsonschema::is_valid(&schema, &instance)); assert!(jsonschema::validate(&schema, &instance).is_ok()); // Build & reuse (faster) let validator = jsonschema::validator_for(&schema)?; // Fail on first error assert!(validator.validate(&instance).is_ok()); // Iterate over errors for error in validator.iter_errors(&instance) { eprintln!("Error: {error}"); eprintln!("Location: {}", error.instance_path()); } // Boolean result assert!(validator.is_valid(&instance)); // Structured output (JSON Schema Output v1) let evaluation = validator.evaluate(&instance); for annotation in evaluation.iter_annotations() { eprintln!( "Annotation at {}: {:?}", annotation.schema_location, annotation.annotations.value() ); } Ok(()) }
Starred by 750 users
Forked by 117 users
Languages ย  Rust 88.8% | Python 6.6% | Ruby 4.3%
๐ŸŒ
jsonschema
python-jsonschema.readthedocs.io
jsonschema 4.26.0 documentation
>>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) >>> validate( ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema, ... ) Traceback (most recent call last): ... ValidationError: 'Invalid' is not of type 'number' It can also be used from the command line by installing check-jsonschema.
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ jsonschema
jsonschema - npm
January 7, 2025 - validator.attributes.contains = function validateContains(instance, schema, options, ctx) { if(typeof instance !== 'string') return; if(typeof schema.contains !== 'string') throw new jsonschema.SchemaError('"contains" expects a string', schema); if(instance.indexOf(schema.contains)<0){ return 'does not contain the string ' + JSON.stringify(schema.contains); } } var result = validator.validate("I am an instance", { type:"string", contains: "I am" }); // result.valid === true;
      ยป npm install jsonschema
    
Published ย  Jan 07, 2025
Version ย  1.5.0
Author ย  Tom de Grunt