All Projects → networknt → Json Schema Validator

networknt / Json Schema Validator

Licence: apache-2.0
A fast Java JSON schema validator that supports draft V4, V6, V7 and V2019-09

Programming Languages

java
68154 projects - #9 most used programming language
java8
65 projects

Projects that are alternatives of or similar to Json Schema Validator

Uvicorn Gunicorn Fastapi Docker
Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python 3.6 and above with performance auto-tuning. Optionally with Alpine Linux.
Stars: ✭ 1,014 (+247.26%)
Mutual labels:  json-schema, openapi3, json
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (-67.81%)
Mutual labels:  openapi3, json, yaml
Jsonj
A fluent Java API for manipulating json data structures
Stars: ✭ 42 (-85.62%)
Mutual labels:  json, yaml, jackson
Full Stack Fastapi Postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Stars: ✭ 7,635 (+2514.73%)
Mutual labels:  json-schema, openapi3, json
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+200%)
Mutual labels:  json-schema, openapi3, json
Jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Stars: ✭ 5,633 (+1829.11%)
Mutual labels:  json-schema, json, jackson
Kaizen Openapi Editor
Eclipse Editor for the Swagger-OpenAPI Description Language
Stars: ✭ 97 (-66.78%)
Mutual labels:  openapi3, json, yaml
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+13457.53%)
Mutual labels:  json-schema, openapi3, json
Full Stack Fastapi Couchbase
Full stack, modern web application generator. Using FastAPI, Couchbase as database, Docker, automatic HTTPS and more.
Stars: ✭ 243 (-16.78%)
Mutual labels:  json-schema, openapi3, json
Korio
Korio: Kotlin cORoutines I/O : Virtual File System + Async/Sync Streams + Async TCP Client/Server + WebSockets for Multiplatform Kotlin 1.3
Stars: ✭ 282 (-3.42%)
Mutual labels:  json, yaml
KaiZen-OpenApi-Parser
High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
Stars: ✭ 119 (-59.25%)
Mutual labels:  yaml, openapi3
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-90.75%)
Mutual labels:  fast, json-schema
jsonschema-generator
Java JSON Schema Generator – creating JSON Schema (Draft 6, Draft 7, Draft 2019-09, or Draft 2020-12) from Java classes
Stars: ✭ 213 (-27.05%)
Mutual labels:  json-schema, jackson
openapi4j
OpenAPI 3 parser, JSON schema and request validator.
Stars: ✭ 92 (-68.49%)
Mutual labels:  json-schema, openapi3
better-serializer
General serializer for PHP. An alternative to JmsSerializer.
Stars: ✭ 27 (-90.75%)
Mutual labels:  fast, jackson
jackson-json-reference
JSON Reference for Java with Jackson.
Stars: ✭ 21 (-92.81%)
Mutual labels:  json-schema, jackson
yajsv
Yet Another JSON Schema Validator [CLI]
Stars: ✭ 42 (-85.62%)
Mutual labels:  yaml, json-schema
json-schema-inferrer
Java library for inferring JSON schema from sample JSONs
Stars: ✭ 78 (-73.29%)
Mutual labels:  json-schema, jackson
restish
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Stars: ✭ 453 (+55.14%)
Mutual labels:  json-schema, openapi3
php-json-schema-model-generator
Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code
Stars: ✭ 36 (-87.67%)
Mutual labels:  json-schema, openapi3

Stack Overflow | Google Group | Gitter Chat | Subreddit | Youtube | Documentation | Javadocs | Contribution Guide |

Build Status codecov.io

This is a Java implementation of the JSON Schema Core Draft v4, v6, v7 and v2019-09 specification for JSON schema validation. In addition, it also works for OpenAPI 3.0 request/response validation with some configuration flags. The default JSON parser is the Jackson that is the most popular one. As it is a key component in our light-4j microservices framework to validate request/response against OpenAPI specification for light-rest-4j and RPC schema for light-hybrid-4j at runtime, performance is the most important aspect in the design.

Why this library

Performance

It is the fastest Java JSON Schema Validator as far as I know. Here is the testing result compare with the other two open-source implementations. It is about 32 times faster than the Fge and five times faster than the Everit.

fge: 7130ms

everit-org: 1168ms

networknt: 223ms

You can run the performance tests for three libraries from https://github.com/networknt/json-schema-validator-perftest

Parser

It uses Jackson that is the most popular JSON parser in Java. If you are using Jackson parser already in your project, it is natural to choose this library over others for schema validation.

YAML Support

The library works with JSON and YAML on both schema definitions and input data.

OpenAPI Support

The OpenAPI 3.0 specification is using JSON schema to validate the request/response, but there are some differences. With a configuration file, you can enable the library to work with OpenAPI 3.0 validation.

Dependency

Following the design principle of the Light Platform, this library has minimum dependencies to ensure there are no dependency conflicts when using it.

Here are the dependencies.

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>${version.jackson}</version>
</dependency>

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>${version.slf4j}</version>
</dependency>

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>${version.common-lang3}</version>
</dependency>

Community

This library is very active with a lot of contributors. New features and bug fixes are handled quickly by the team members. Because it is an essential dependency of the light-4j framework in the same GitHub organization, it will be evolved and maintained along with the framework.

Prerequisite

The library supports Java 8 and up. If you want to build from the source code, you need to install JDK 8 locally. To support multiple version of JDK, you can use SDKMAN

Dependency

This package is available on Maven central.

Maven:

<dependency>
    <groupId>com.networknt</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>1.0.50</version>
</dependency>

Gradle:

dependencies {
    compile(group: "com.networknt", name: "json-schema-validator", version: "1.0.50");
}

For the latest version, please check the release page.

Quick Start

Validators

Configuration

Specification Version

YAML Validation

Schema Mapping

Customized URIFetcher

Customized MetaSchema

Collector Context

JSON Schema Walkers and WalkListeners

ECMA-262 Regex

Known issues

I have just updated the test suites from the official website as the old ones were copied from another Java validator. Now there are several issues that need to be addressed. All of them are edge cases, in my opinion, but need to be investigated. As my old test suites were inherited from another Java JSON Schema Validator, I guess other Java Validator would have the same issues as these issues are in the Java language itself.

#7

#5

Projects

The light-rest-4j, light-graphql-4j and light-hybrid-4j use this library to validate the request and response based on the specifications. If you are using other frameworks like Spring Boot, you can use the OpenApiValidator, a generic OpenAPI 3.0 validator based on the OpenAPI 3.0 specification.

If you have a project using this library, please submit a PR to add your project below.

Contributors

Thanks to the following people who have contributed to this project. If you are using this library, please consider to be a sponsor for one of the contributors.

@stevehu

@jiachen1120

@BalloonWen

@eskabetxe

@ddobrin

@ehrmann

@rhwood

@nitin1891

@jawaff

@kosty

@chenyan71

@chrisken

@NicholasAzar

@basinilya

For all contributors, please visit https://github.com/networknt/json-schema-validator/graphs/contributors

If you are a contributor, please join the GitHub Sponsors and switch the link to your sponsors dashboard via a PR.

Sponsors

Individual Sponsors

Corporation Sponsors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].