Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ Here is a single *test case*, containing one or more tests:

### Subdirectories Within Each Version directory

There is currently only one additional subdirectory that may exist within each specification version test directory.
A specification version test directory may contain one or more subdirectories.

This is:
These are:

1. `optional/`: Contains tests that are considered optional.
1. `optional/`: Contains tests that are considered optional. Note that this subdirectory currently conflates many reasons why a test may be optional -- it may be because tests within a particular file are indeed not required by the specification but still potentially useful to an implementer, or it may be because tests within it only apply to programming languages with particular functionality (in which case they are not truly optional in such a language). In the future this directory structure will be made richer to reflect these differences more clearly.

Note, the `optional/` subdirectory today conflates many reasons why a test may be optional -- it may be because tests within a particular file are indeed not required by the specification but still potentially useful to an implementer, or it may be because tests within it only apply to programming languages with particular functionality (in
which case they are not truly optional in such a language).
In the future this directory structure will be made richer to reflect these differences more clearly.
2. `proposals/`: Contains a subfolder for each active proposal to the specification. If the proposal is a keyword (generally the case), then the subfolder will bear the name of that keyword. Inside the proposal subfolder is a series of test files that would contain amendments to the required test suite should the proposal be incorporated into the specification. These test should be considered volitile while the proposal is in development, however implementations claiming to support the proposal are expected to pass its tests.

## Using the Suite to Test a Validator Implementation

Expand Down
35 changes: 0 additions & 35 deletions tests/v1/additionalProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,41 +177,6 @@
}
]
},
{
"description": "propertyDependencies with additionalProperties",
"schema": {
"$schema": "https://json-schema.org/v1",
"properties" : {"foo2" : {}},
"propertyDependencies": {
"foo" : {},
"foo2": {
"bar": {
"properties": {
"buz": {}
}
}
}
},
"additionalProperties": false
},
"tests": [
{
"description": "additionalProperties doesn't consider propertyDependencies properties" ,
"data": {"foo": ""},
"valid": false
},
{
"description": "additionalProperties can't see buz even when foo2 is present",
"data": {"foo2": "bar", "buz": ""},
"valid": false
},
{
"description": "additionalProperties can't see buz",
"data": {"buz": ""},
"valid": false
}
]
},
{
"description": "dependentSchemas with additionalProperties",
"schema": {
Expand Down
157 changes: 0 additions & 157 deletions tests/v1/dynamicRef.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,83 +123,6 @@
}
]
},
{
"description": "multiple dynamic paths to the $dynamicRef keyword",
"schema": {
"$schema": "https://json-schema.org/v1",
"$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main",
"propertyDependencies": {
"kindOfList": {
"numbers": { "$ref": "numberList" },
"strings": { "$ref": "stringList" }
}
},
"$defs": {
"genericList": {
"$id": "genericList",
"properties": {
"list": {
"items": { "$dynamicRef": "#itemType" }
}
}
},
"numberList": {
"$id": "numberList",
"$defs": {
"itemType": {
"$dynamicAnchor": "itemType",
"type": "number"
}
},
"$ref": "genericList"
},
"stringList": {
"$id": "stringList",
"$defs": {
"itemType": {
"$dynamicAnchor": "itemType",
"type": "string"
}
},
"$ref": "genericList"
}
}
},
"tests": [
{
"description": "number list with number values",
"data": {
"kindOfList": "numbers",
"list": [1.1]
},
"valid": true
},
{
"description": "number list with string values",
"data": {
"kindOfList": "numbers",
"list": ["foo"]
},
"valid": false
},
{
"description": "string list with number values",
"data": {
"kindOfList": "strings",
"list": [1.1]
},
"valid": false
},
{
"description": "string list with string values",
"data": {
"kindOfList": "strings",
"list": ["foo"]
},
"valid": true
}
]
},
{
"description": "after leaving a dynamic scope, it is not used by a $dynamicRef",
"schema": {
Expand Down Expand Up @@ -440,86 +363,6 @@
}
]
},
{
"description": "$dynamicAnchor inside propertyDependencies",
"schema": {
"$schema": "https://json-schema.org/v1",
"$id": "http://localhost:1234/v1/dynamicanchor-in-propertydependencies.json",
"$defs": {
"inner": {
"$id": "inner",
"$dynamicAnchor": "foo",
"type": "object",
"properties": {
"expectedTypes": {
"type": "string"
}
},
"additionalProperties": {
"$dynamicRef": "#foo"
}
}
},
"propertyDependencies": {
"expectedTypes": {
"strings": {
"$id": "east",
"$ref": "inner",
"$defs": {
"foo": {
"$dynamicAnchor": "foo",
"type": "string"
}
}
},
"integers": {
"$id": "west",
"$ref": "inner",
"$defs": {
"foo": {
"$dynamicAnchor": "foo",
"type": "integer"
}
}
}
}
}
},
"tests": [
{
"description": "expected strings - additional property as string is valid",
"data": {
"expectedTypes": "strings",
"anotherProperty": "also a string"
},
"valid": true
},
{
"description": "expected strings - additional property as not string is invalid",
"data": {
"expectedTypes": "strings",
"anotherProperty": 42
},
"valid": false
},
{
"description": "expected integers - additional property as integer is valid",
"data": {
"expectedTypes": "integers",
"anotherProperty": 42
},
"valid": true
},
{
"description": "expected integers - additional property as not integer is invalid",
"data": {
"expectedTypes": "integers",
"anotherProperty": "a string"
},
"valid": false
}
]
},
{
"description": "$ref to $dynamicRef finds detached $dynamicAnchor",
"schema": {
Expand Down
10 changes: 10 additions & 0 deletions tests/v1/proposals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# JSON Schema Proposals Tests

The subfolders herein represent tests for each active proposal to the specification. If the proposal is a keyword (generally the case), then the subfolder will bear the name of that keyword. Inside the proposal subfolder is a series of test files that would contain amendments to the required test suite should the proposal be incorporated into the specification. These test should be considered volitile while the proposal is in development, however implementations claiming to support the proposal are expected to pass its tests.

> [!IMPORTANT]
> This folder is NOT intended for proposed additions to the test suite or the specification.
Proposals to the test suite can be made by [opening an issue](https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/new) in this repository.

Proposals to the specification should be made by following the process defined by our [Feature Life Cycle](https://github.com/json-schema-org/json-schema-spec/blob/main/PROCESS.md#feature-life-cycle).
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"description": "propertyDependencies with additionalProperties",
"schema": {
"$schema": "https://json-schema.org/v1",
"properties" : {"foo2" : {}},
"propertyDependencies": {
"foo" : {},
"foo2": {
"bar": {
"properties": {
"buz": {}
}
}
}
},
"additionalProperties": false
},
"tests": [
{
"description": "additionalProperties doesn't consider propertyDependencies properties" ,
"data": {"foo": ""},
"valid": false
},
{
"description": "additionalProperties can't see buz even when foo2 is present",
"data": {"foo2": "bar", "buz": ""},
"valid": false
},
{
"description": "additionalProperties can't see buz",
"data": {"buz": ""},
"valid": false
}
]
}
]
Loading
Loading