This is a Scala implementation of a JSON Schema validator based upon the great io.circe Library.
Note: the validator is in early state and API may not be stable.
- Implementing JSON Schema 2020-12, 2019-09
- All tests of the JSON Schema Test Suite passing
- You can bring your own Downloader (using Tagless Final Pattern)
- Support for Scala 2.12, 2.13 and 3
dynamicRefanddynamicAnchorare very rough implemented- Unknown Keywords are ignored and won't be serialized again.
- Only JSON Schema 2020-12, 2019-09 and one Circe-Version supported so far.
- The API will only be stable in patch versions
Regex Patterns are directly given to java.util.regex.Pattern.compile. This could be not secure and could lead to ReDoS Attacks. Do not trust JSON schemas from an untrusted source.
Only use this library for trusted JSON-Schemas
This is BETA-Software. Use at your own risk.
Please have a look in the examples folder for some Examples.
There are some main Types
Jsonthe JSON Representation of the Circe-Library.Schemarepresents a single JSON-Schema and can be parsed fromJson.Validatora single validator validating some JSONValidationResultthe result of a validation, contains possible violations.DocumentValidatora validator for a full set of JSON-Schema-Documents. This is what you want to use for ValidatingSingleDocumentValidatorrepresenting a single document withinDocumentValidatorLoaderthe main entry point to load and parse JSON-Schemas, which provide a DocumentValidator for you.Downloaderduring resolving, it is possible, that additional URLs need to be downloaded. The downloader is responsible for that and you can bring your own. There exists a dummy implementation which doesn't download anythingDownloader.emptySimpleand an implementation which is using Java-URL-FacilitiesDownloader.JavaUrlDownloader
The library is released under terms of Apache License 2.0
3rdparty contans 3rd-Party references
JSON-Schema-Test-Suite, licensed under terms of MIT-Licenseschemacontains the JSON Schemas of JSON Schema, released unter terms of BSD-License.