-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing vocabulary spec to 2020-12
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
Solutions/Corvus.Json.Specs/Features/JsonSchema/Draft2020212/vocabulary.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@draft2020-12 | ||
|
||
Feature: vocabulary draft2020-12 | ||
In order to use json-schema | ||
As a developer | ||
I want to support vocabulary in draft2020-12 | ||
|
||
Scenario Outline: schema that uses custom metaschema with with no validation vocabulary | ||
/* Schema: | ||
{ | ||
"$id": "https://schema/using/no/validation", | ||
"$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json", | ||
"properties": { | ||
"badProperty": false, | ||
"numberProperty": { | ||
"minimum": 10 | ||
} | ||
} | ||
} | ||
*/ | ||
Given the input JSON file "vocabulary.json" | ||
And the schema at "#/0/schema" | ||
And the input data at "<inputDataReference>" | ||
And I generate a type for the schema | ||
And I construct an instance of the schema type from the data | ||
When I validate the instance | ||
Then the result will be <valid> | ||
|
||
Examples: | ||
| inputDataReference | valid | description | | ||
# { "badProperty": "this property should not exist" } | ||
| #/000/tests/000/data | false | applicator vocabulary still works | | ||
# { "numberProperty": 20 } | ||
| #/000/tests/001/data | true | no validation: valid number | | ||
# { "numberProperty": 1 } | ||
| #/000/tests/002/data | true | no validation: invalid number, but it still validates | | ||
|
||
Scenario Outline: ignore unrecognized optional vocabulary | ||
/* Schema: | ||
{ | ||
"$schema": "http://localhost:1234/draft2020-12/metaschema-optional-vocabulary.json", | ||
"type": "number" | ||
} | ||
*/ | ||
Given the input JSON file "vocabulary.json" | ||
And the schema at "#/1/schema" | ||
And the input data at "<inputDataReference>" | ||
And I generate a type for the schema | ||
And I construct an instance of the schema type from the data | ||
When I validate the instance | ||
Then the result will be <valid> | ||
|
||
Examples: | ||
| inputDataReference | valid | description | | ||
# foobar | ||
| #/001/tests/000/data | false | string value | | ||
# 20 | ||
| #/001/tests/001/data | true | number value | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters