Skip to content

Commit

Permalink
Merge pull request #176 from davishmcclurg/2.2.0
Browse files Browse the repository at this point in the history
2.2.0
  • Loading branch information
davishmcclurg authored Mar 2, 2024
2 parents b8adf14 + 045a95d commit 67c52f0
Show file tree
Hide file tree
Showing 95 changed files with 23,571 additions and 21,172 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [2.2.0] - XXXX-XX-XX

## Bug Fixes

- Support symbol keys when accessing original instance: https://github.com/davishmcclurg/json_schemer/commit/d52c130e9967919c6cf1c9dbc3f0babfb8b01cf8
- Support custom keywords in nested schemas: https://github.com/davishmcclurg/json_schemer/commit/93c85a5006981347c7e9a4c11b73c6bdb65d8ba2
- Stringify instance location for custom keywords: https://github.com/davishmcclurg/json_schemer/commit/513c99130b9e7986b09881e7efd3fb7143744754
- Reduce unhelpful error output in `unevaluated` keywords: https://github.com/davishmcclurg/json_schemer/pull/164
- Handle parse errors during schema validation: https://github.com/davishmcclurg/json_schemer/pull/171
- Follow refs when finding default property values: https://github.com/davishmcclurg/json_schemer/pull/175

## Features

- Global configuration with `Configuration` object: https://github.com/davishmcclurg/json_schemer/pull/170
- Symbol key property defaults with `insert_property_defaults: :symbol`: https://github.com/davishmcclurg/json_schemer/commit/a72473dc84199107ddedc8998950e5b82273232a
- Consistent schema type support for schema validation methods: https://github.com/davishmcclurg/json_schemer/commit/bbcd0cea20cbaa61cf2bdae5f53840861cae54b8
- Validation option support for schema validation methods: https://github.com/davishmcclurg/json_schemer/commit/2eeef77de522f127619b7d0faa51e0d7e40977ad

[2.2.0]: https://github.com/davishmcclurg/json_schemer/releases/tag/v2.2.0

## [2.1.1] - 2023-11-28

### Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
json_schemer (2.1.1)
json_schemer (2.2.0)
base64
bigdecimal
hana (~> 1.3)
Expand All @@ -12,8 +12,8 @@ GEM
remote: https://rubygems.org/
specs:
base64 (0.2.0)
bigdecimal (3.1.5)
bigdecimal (3.1.5-java)
bigdecimal (3.1.6)
bigdecimal (3.1.6-java)
concurrent-ruby (1.2.2)
csv (3.2.8)
docile (1.4.0)
Expand All @@ -24,7 +24,7 @@ GEM
i18n (< 2)
minitest (5.15.0)
rake (13.1.0)
regexp_parser (2.8.3)
regexp_parser (2.9.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand Down
11 changes: 9 additions & 2 deletions JSON-Schema-Test-Suite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To test a specific version:

* For 2019-09 and later published drafts, implementations that are able to detect the draft of each schema via `$schema` SHOULD be configured to do so
* For draft-07 and earlier, draft-next, and implementations unable to detect via `$schema`, implementations MUST be configured to expect the draft matching the test directory name
* Load any remote references [described below](additional-assumptions) and configure your implementation to retrieve them via their URIs
* Load any remote references [described below](#additional-assumptions) and configure your implementation to retrieve them via their URIs
* Walk the filesystem tree for that version's subdirectory and for each `.json` file found:

* if the file is located in the root of the version directory:
Expand Down Expand Up @@ -159,7 +159,7 @@ If your implementation supports multiple versions, run the above procedure for e
```

2. Test cases found within [special subdirectories](#subdirectories-within-each-draft) may require additional configuration to run.
In particular, tests within the `optional/format` subdirectory may require implementations to change the way they treat the `"format"`keyword (particularly on older drafts which did not have a notion of vocabularies).
In particular, when running tests within the `optional/format` subdirectory, test runners should configure implementations to enable format validation, where the implementation supports it.

### Invariants & Guarantees

Expand Down Expand Up @@ -254,12 +254,14 @@ This suite is being used by:

### Java

* [json-schema-validation-comparison](https://www.creekservice.org/json-schema-validation-comparison/functional) (Comparison site for JVM-based validator implementations)
* [json-schema-validator](https://github.com/daveclayton/json-schema-validator)
* [everit-org/json-schema](https://github.com/everit-org/json-schema)
* [networknt/json-schema-validator](https://github.com/networknt/json-schema-validator)
* [Justify](https://github.com/leadpony/justify)
* [Snow](https://github.com/ssilverman/snowy-json)
* [jsonschemafriend](https://github.com/jimblackler/jsonschemafriend)
* [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)

### JavaScript

Expand All @@ -279,6 +281,10 @@ This suite is being used by:
* [ajv](https://github.com/epoberezkin/ajv)
* [djv](https://github.com/korzio/djv)

### Kotlin

* [json-schema-validation-comparison](https://www.creekservice.org/json-schema-validation-comparison/functional) (Comparison site for JVM-based validator implementations)

### Node.js

For node.js developers, the suite is also available as an [npm](https://www.npmjs.com/package/@json-schema-org/tests) package.
Expand Down Expand Up @@ -327,6 +333,7 @@ Node-specific support is maintained in a [separate repository](https://github.co

### Scala

* [json-schema-validation-comparison](https://www.creekservice.org/json-schema-validation-comparison/functional) (Comparison site for JVM-based validator implementations)
* [typed-json](https://github.com/frawa/typed-json)

### Swift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/next/vocab/core": true,
"https://json-schema.org/draft/next/vocab/format-assertion": false
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/next/meta/core" },
{ "$ref": "https://json-schema.org/draft/next/meta/format-assertion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/next/vocab/core": true,
"https://json-schema.org/draft/next/vocab/format-assertion": true
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/next/meta/core" },
{ "$ref": "https://json-schema.org/draft/next/meta/format-assertion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/next/vocab/applicator": true,
"https://json-schema.org/draft/next/vocab/core": true
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/next/meta/applicator" },
{ "$ref": "https://json-schema.org/draft/next/meta/core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"https://json-schema.org/draft/next/vocab/core": true,
"http://localhost:1234/draft/next/vocab/custom": false
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/next/meta/validation" },
{ "$ref": "https://json-schema.org/draft/next/meta/core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
"https://json-schema.org/draft/2019-09/vocab/core": true
},
"$recursiveAnchor": true,
"allOf": [
{ "$ref": "https://json-schema.org/draft/2019-09/meta/applicator" },
{ "$ref": "https://json-schema.org/draft/2019-09/meta/core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"https://json-schema.org/draft/2019-09/vocab/core": true,
"http://localhost:1234/draft/2019-09/vocab/custom": false
},
"$recursiveAnchor": true,
"allOf": [
{ "$ref": "https://json-schema.org/draft/2019-09/meta/validation" },
{ "$ref": "https://json-schema.org/draft/2019-09/meta/core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/2020-12/vocab/core": true,
"https://json-schema.org/draft/2020-12/vocab/format-assertion": false
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/format-assertion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/2020-12/vocab/core": true,
"https://json-schema.org/draft/2020-12/vocab/format-assertion": true
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/format-assertion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
"https://json-schema.org/draft/2020-12/vocab/core": true
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"https://json-schema.org/draft/2020-12/vocab/core": true,
"http://localhost:1234/draft/2020-12/vocab/custom": false
},
"$dynamicAnchor": "meta",
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/validation" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" }
Expand Down
90 changes: 0 additions & 90 deletions JSON-Schema-Test-Suite/tests/draft-next/anchor.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,64 +81,6 @@
}
]
},
{
"description": "$anchor inside an enum is not a real identifier",
"comment": "the implementation must not be confused by an $anchor buried in the enum",
"schema": {
"$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"anchor_in_enum": {
"enum": [
{
"$anchor": "my_anchor",
"type": "null"
}
]
},
"real_identifier_in_schema": {
"$anchor": "my_anchor",
"type": "string"
},
"zzz_anchor_in_const": {
"const": {
"$anchor": "my_anchor",
"type": "null"
}
}
},
"anyOf": [
{ "$ref": "#/$defs/anchor_in_enum" },
{ "$ref": "#my_anchor" }
]
},
"tests": [
{
"description": "exact match to enum, and type matches",
"data": {
"$anchor": "my_anchor",
"type": "null"
},
"valid": true
},
{
"description": "in implementations that strip $anchor, this may match either $def",
"data": {
"type": "null"
},
"valid": false
},
{
"description": "match $ref to $anchor",
"data": "a string to match #/$defs/anchor_in_enum",
"valid": true
},
{
"description": "no match on enum or $ref to $anchor",
"data": 1,
"valid": false
}
]
},
{
"description": "same $anchor with different base uri",
"schema": {
Expand Down Expand Up @@ -175,38 +117,6 @@
}
]
},
{
"description": "non-schema object containing an $anchor property",
"schema": {
"$schema": "https://json-schema.org/draft/next/schema",
"$defs": {
"const_not_anchor": {
"const": {
"$anchor": "not_a_real_anchor"
}
}
},
"if": {
"const": "skip not_a_real_anchor"
},
"then": true,
"else" : {
"$ref": "#/$defs/const_not_anchor"
}
},
"tests": [
{
"description": "skip traversing definition for a valid result",
"data": "skip not_a_real_anchor",
"valid": true
},
{
"description": "const at const_not_anchor does not match",
"data": 1,
"valid": false
}
]
},
{
"description": "invalid anchors",
"schema": {
Expand Down
Loading

0 comments on commit 67c52f0

Please sign in to comment.