Skip to content

Add draft 2019-09 to readme #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ val valid = schema.validate(elementToValidate, errors::add)
## Supported JSON schema drafts:

- [Draft 7](https://json-schema.org/specification-links.html#draft-7)
- Keywords
<details>
<summary>Supported keywords</summary>

- Core

| Keyword | Status |
|:------------|:----------------------------------------------------------------------------------------------------|
Expand Down Expand Up @@ -166,6 +169,60 @@ val valid = schema.validate(elementToValidate, errors::add)
| | anyOf | Supported (all validation will be executed even if the element matches the first one) |
| | oneOf | Supported |
| | not | Supported |
</details>
- [Draft 2019-09](https://json-schema.org/specification-links#draft-2019-09-(formerly-known-as-draft-8))
<details>
<summary>Supported keywords</summary>

- Core

| Keyword | Status |
|:------------------|:----------------------------------------------------------------------------------------------------|
| $id | Supported. $id in sub-schemas are collected as well and can be used in $ref |
| $schema | Supported. Validates if schema is one of the supported schemas. The last supported is used if empty |
| $ref | Supported (except references to schemas from another document) |
| $recursiveRef | Supported (does not work yet to extend schemas from other documents) |
| $defs/definitions | Supported. Definitions are loaded and can be referenced |

- Assertions

| Category | Assertion | Status |
|:--------------|:----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------|
| General | type | Supported all type [defined in the specification](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.1.1) |
| | enum | Supported |
| | const | Supported |
| Numbers | multipleOf | Supported |
| | maximum | Supported |
| | exclusiveMaximum | Supported |
| | minimum | Supported |
| | exclusiveMinimum | Supported |
| Strings | maxLength | Supported |
| | minLength | Supported |
| | pattern | Supported (kotlin.text.Regex is used) |
| Arrays | items | Supported |
| | additionalItems | Supported |
| | unevaluatedItems | Supported |
| | maxItems | Supported |
| | uniqueItems | Supported |
| | contains | Supported |
| | minContains | Supported (does not affect the work of contains assertion anyhow even if minContains=0) |
| | maxContains | Supported |
| Objects | maxProperties | Supported |
| | minProperties | Supported |
| | required | Supported |
| | properties | Supported |
| | patternProperties | Supported (kotlin.text.Regex is used) |
| | additionalProperties | Supported |
| | unevaluatedProperties | Supported |
| | dependentRequired | Supported |
| | dependentSchemas | Supported |
| | propertyNames | Supported |
| Conditions | if/then/else | Supported |
| Boolean logic | allOf | Supported |
| | anyOf | Supported (all validation will be executed even if the element matches the first one) |
| | oneOf | Supported |
| | not | Supported |
</details>

## Compliance to JSON schema test suites

Expand All @@ -179,6 +236,6 @@ The test are located [here](test-suites).
- [x] Add `$schema` property validation (if not set the latest supported will be used)
- [x] Add proper `$id` support (for nested schemas and for referencing)
- [ ] Add support for newer drafts
- [ ] [Draft 2019-09 (Draft 8)](https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8)
- [x] [Draft 2019-09 (Draft 8)](https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8)
- [ ] [2020-12](https://json-schema.org/specification-links.html#2020-12)
- [ ] Formalize error output as it is defined in the latest drafts (have not fully decided if it should be done)