Skip to content
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

2.2.0 #176

Merged
merged 36 commits into from
Mar 2, 2024
Merged

2.2.0 #176

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
798c1ff
fix existing specs
omkarmoghe Jan 14, 2024
93e3439
array wrap safety
omkarmoghe Jan 14, 2024
b2af959
specs
omkarmoghe Jan 20, 2024
3cb05b6
warning fix
omkarmoghe Jan 20, 2024
92a64a7
Use `BINARY` instead of `ASCII_8BIT`
davishmcclurg Dec 16, 2023
9601155
Maintain input encoding when percent encoding
davishmcclurg Dec 16, 2023
d52c130
Support symbol keys for hooks & property defaults
davishmcclurg Dec 16, 2023
93c85a5
Use root schema for custom keywords
davishmcclurg Dec 16, 2023
513c991
Pass resolved instance location to custom keywords
davishmcclurg Dec 16, 2023
094362a
Consider all siblings in `unevaluated` keywords
davishmcclurg Nov 16, 2023
e8750cf
Add false schema errors for unevaluated keywords
davishmcclurg Dec 16, 2023
a72473d
Add symbol option to `insert_property_defaults`
davishmcclurg Jan 20, 2024
1a4c685
Only parse `$schema` during schema validation
davishmcclurg Jan 20, 2024
bbcd0ce
Support String and Pathname schema validation
davishmcclurg Jan 20, 2024
2eeef77
Allow passing options to schema validation methods
davishmcclurg Jan 23, 2024
f96babe
Follow refs when finding default property values
davishmcclurg Feb 25, 2024
dc87ce2
Merge branch '2.2.0' into default-config
davishmcclurg Mar 1, 2024
c4af895
Drop option checks
davishmcclurg Mar 1, 2024
227eae9
Use regular class format for error classes
davishmcclurg Mar 1, 2024
61a4b23
Drop `original` prefix from config options
davishmcclurg Mar 1, 2024
255fb9e
Consistent configuration option names
davishmcclurg Mar 1, 2024
2b4b2e7
Drop `parallelize_me!`
davishmcclurg Mar 1, 2024
0a6f1c5
Drop array wrap for property validation options
davishmcclurg Mar 1, 2024
dea3e80
Add remaining options to configuration object
davishmcclurg Mar 1, 2024
93a3cb2
Parse string meta schemas in `Schema` class
davishmcclurg Mar 2, 2024
3323ef4
Add `configuration` argument
davishmcclurg Mar 2, 2024
16d008b
Drop defined check for class variable in i18n test
davishmcclurg Mar 2, 2024
c1507fe
Simplify `Configuration`
davishmcclurg Mar 2, 2024
6b536e8
Add `Configuration` functionality tests
davishmcclurg Mar 2, 2024
8803d3b
Merge pull request #170 from omkarmoghe/default-config
davishmcclurg Mar 2, 2024
49ff77e
Merge pull request #175 from davishmcclurg/ref-default
davishmcclurg Mar 2, 2024
f3f81e3
Squashed 'JSON-Schema-Test-Suite/' changes from d38ddd54..bf0360f4
davishmcclurg Mar 2, 2024
223e9bc
Merge commit 'f3f81e356cc3fe0236efe3929888286ec53cfe73' into 2.2.0
davishmcclurg Mar 2, 2024
580742d
Update JSON-Schema-Test-Suite fixtures
davishmcclurg Mar 2, 2024
20cc3f8
2.2.0
davishmcclurg Mar 2, 2024
045a95d
Global configuration documentation
davishmcclurg Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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