Skip to content

Commit 56ee673

Browse files
committed
Squashed 'json/' changes from ab3924a6..9ad349be
9ad349be Merge pull request python-jsonschema#773 from jdesrosiers/annotation-propname-desc f164982c Merge pull request python-jsonschema#771 from bavulapati/add-blaze-as-consumer d2bd2ad2 Update annotation test description for propertyNames a7a64707 Add [Blaze](https://github.com/sourcemeta/blaze) to the README 9f256c88 Change "expected" to an object with schema locations 7f996868 Update content tests to only apply to string instances 5338ecd1 Remove tests that assert a keyword doesn't emit annotations 738653b5 Make order of assertion properties consistent 8b5de3b9 Updates based on feedback from Juan 6270e399 Updates based on feedback from Karen 341df3ec Add automation to check that annotation tests are valid 16988c67 Add annotation tests bc919bdb Merge pull request python-jsonschema#755 from V02460/unevaluated-additional-properties 83e866b4 Merge pull request python-jsonschema#763 from michaelmior/propertynames-const c5a9703f Merge pull request python-jsonschema#760 from OptimumCode/rfc3490-label-separator b4c09b65 Add tests for propertyNames with const/enum 4fa572d8 Move tests for rfc3490#3.1 into a separate test case ce9f68ca Add link to rfc and quote ad94cacc Add test cases for other valid label separators in IDN hostnames 39002ae7 Merge pull request python-jsonschema#762 from OptimumCode/rfc-html-link c8780535 Correct section anchor for rfc URL template 5f2ca7d6 Modify rfc url template to use html version 9c5d99b6 Merge pull request python-jsonschema#761 from OptimumCode/annotation-script-rfc-support 9563ce7b Correct rfc URL template - incorrect path pattern was used 961bfad0 Correct spec kind extraction from defined key. Continue on unkown URL kind e524505b Merge pull request python-jsonschema#759 from sirosen/hostname-format-reject-single-dot 4a3efd18 Add negative tests for "." for hostname formats 4ba013d5 Merge pull request python-jsonschema#747 from santhosh-tekuri/duration aa500e80 Merge pull request python-jsonschema#749 from json-schema-org/gregsdennis/json-everything-update eb8ce976 Merge pull request python-jsonschema#757 from ajevans99/main dcdae5c0 Merge pull request python-jsonschema#758 from sirosen/hostname-format-check-empty-string db21d21b Merge branch 'main' into hostname-format-check-empty-string 3fd78f04 Merge pull request python-jsonschema#1 from ajevans99/swift-json-schema 3cada3a9 Update README.md 5273e0d6 Make test descriptions more specific 43828fee Simplify adjacent additionalProperties test 347d6099 unevaluatedProperties: Remove type keywords 7dfbb1e9 Add test for unevaluatedProperties 82a07749 Merge pull request python-jsonschema#753 from json-schema-org/ether/fix-draft-locations a66d23d4 move draft-specific files to the dedicated dir for its draft 8ef15501 Merge pull request python-jsonschema#751 from big-andy-coates/format_tests_under_format fe1b1392 All format test cases should be under the `format` directory. b1ee90f6 json-everything moved to an org c00a3f94 test: duration format must start with P 9fc880bf Merge pull request python-jsonschema#740 from notEthan/format-pattern-control-char cbd48ea5 Simplify test of \a regex character to test directly against `pattern` schema d6f1010a Merge pull request python-jsonschema#746 from json-schema-org/annotations 4aec22c1 Revert the changes to additionalProperties.json. 2dc10671 Move the workflow step title. d9ce71ac May as well also show quotes in the annotation. 1b719a84 Pick the line after the description when attaching spec annotations. 08105151 Markdown is apparently not (yet?) supported in annotations. 81645773 Tidy up the specification annotator a bit. 38628b79 Make the spec URLs structure a bit easier for internal use. 4ebbeaf4 Merge branch 'Era-cell/main' e4bd7554 dumbness2 corrected d8ade402 inside run 57c7c869 changed install location 11f8e511 Added installing command in workflow f2766616 template library, url loads changes c2badb12 Merge pull request python-jsonschema#734 from OptimumCode/idn-hostname-arabic-indic-mixed dd9599a5 Merge branch 'main' of github.com:json-schema-org/JSON-Schema-Test-Suite 5b393436 add pr dependencies action 3a509007 Clear existin annotations on same PR 23674123 Cases for rfc and iso written separately 0b780b2c Corected yaml format 2b1ffb74 Best practices followed with optimized code e88a2da6 Works for all OS 7b40efe4 Base path for neighbouring file? 564e6957 Walking through all leaf files 7b84fb44 Merge branch 'main' of https://github.com/Era-cell/JSON-Schema-Test-Suite 891d0265 First workflow2 1c175195 regex correction 96f7683a Final correction2 - file names beautufied 5f050a07 Final correction1 77527b63 Stupidity corrected eb8fd760 Branch name specified 540a269b Log2 f29d090a Wrong location sepcification 582e12be logging logs check df3bdecc path corrected c6b937ca Reading all jsons and spec urls added cbdd1755 change day2 54f3784a Merge pull request python-jsonschema#731 from MeastroZI/main 79dc92f1 TOKEN ce52852d Python file location changed 3558c2c6 Fake add to tests eecc7b7a Merge branch 'main' of https://github.com/Era-cell/JSON-Schema-Test-Suite 810d148a First workflow2 4eac02c7 First workflow ff29264c Merge pull request python-jsonschema#741 from harrel56/chore/tabs-to-spaces 9f39cf73 use spaces instead of tabs 2f3b5f7a Corrected replaced unevaluated with additoinalProperties 40bcb8b3 Corrected replaced unevaluated with additoinalProperties fa9224d7 Merge pull request python-jsonschema#732 from MeastroZI/main2 83bedd5c Changing descriptions 49f73429 fixing tests e6d6a081 adding more test cases 7e6c9be6 changing descriptions 959aca92 shifting test 605d7d78 Update propertyDependencies.json : test must be tests deb82824 test for dependentSchema and propertyDependencies with unevaluatedProperties and additionalProperties ea485124 Merge branch 'json-schema-org:main' into main 64a3e7b3 Merge pull request python-jsonschema#721 from json-schema-org/gregsdennis/dynamicref-skips-resources b9f14e64 Fix $schema in new new test 3d5048e8 Merge pull request python-jsonschema#733 from Era-cell/main 4ae14268 Add valid first character to avoid Bidi rule violation 2480edba Update additionalProperties.json formatting it 6aa79c0b Update additionalProperties.json formatting it 3e0139a5 Update tests/draft-next/additionalProperties.json 616240b0 Update tests/draft-next/additionalProperties.json c5f3e4ea Update tests/draft2020-12/propertyNames.json 964efb8e propertyNames doesn't affect additionalProperties, tests exist already for unevaluatedProps f08b884c Cases go under additional and unevaluated Properties 99864ff6 added tests for propertyNames with additionalProperties/unevaluatedProperties, also with specification property 3b5782b6 Update ref.json : changing $Ids 546b3561 test for $ref with $recursiveAnchor 57617f25 Merge pull request python-jsonschema#726 from Era-cell/main 51fc69cd meta data and property names constraints added, additional Items: string 9b169bed specification takes array of objects having section and quote 1362a8cc Pattern for para corrected 340116ec Schema of specification in much structured 003ac021 Test-schema including sub-schema for scpecification 50a20280 adding specification enhancement for additionalProperties 604f5f99 Drop tests of `$id` and `$anchor` that just test values against meta-schema `pattern` for those properties 9cd64ec9 come on man, save all the files f494440e use unique $id in optional tests, too 468453b0 use unique $id 9ec6d17e fix copy/paste error b284f423 add tests for $dynamicRef skipping over resources bf0360f4 add $recursiveAnchor to 2019-09 meta-schemas 0519d1f0 add $dynamicAnchor to meta-schemas b41167c7 Merge pull request python-jsonschema#714 from json-schema-org/more-not 4221a55a Add tests for not: {} schemas for all values. c499d1d2 Merge pull request python-jsonschema#713 from spacether/patch-1 24a471bd Update README.md 544f7c3d Merge pull request python-jsonschema#712 from otto-ifak/main 9dad3ebe Add tests for enum with array of bool 589a0858 Merge pull request python-jsonschema#706 from marksparkza/unevaluated-before-ref 64d5cab9 Merge pull request python-jsonschema#710 from spacether/patch-1 418cdbd6 Removes idea folder e0a9e066 Updates all other tests to mention grapheme/graphemes 217bf81b Merge pull request python-jsonschema#701 from json-schema-org/ether/dynamicRef-boolean 7a3d06d7 I remove a test that doesn't make sense. e8bf453d Move tests with ids in non-schemas to optional 69136952 Update minLength.json d545be21 Fix duplidate identifiers in recently added tests 4e9640c8 test when $dynamicRef references a boolean schema 3dab98ca Merge pull request python-jsonschema#705 from json-schema-org/gregsdennis/remove-contains-objects-tests 1d3aa495 remove more maxContains 4a2c61e8 Test unevaluatedItems|Properties before $ref ec553d76 contains no longer applies to objects 0433a2bf Merge pull request python-jsonschema#704 from big-andy-coates/clarify-format-requirements c685195f Merge pull request python-jsonschema#703 from big-andy-coates/link-to-creek-validator-comprison-site a46174b0 Add more detail around test runner requirements for `format` tests bb1de8a9 The site linked to is a data-driven functional and performance benchmark of JVM based validator implementations. d38ddd54 Merge pull request python-jsonschema#696 from jdesrosiers/unevaluated-dynamicref 5d0c05fa Fix copy/paste error 95fe6ca2 Merge pull request python-jsonschema#694 from json-schema-org/heterogeneous-additionalItems 9c88a0be Merge pull request python-jsonschema#697 from json-schema-org/gregsdennis/add-ref-into-known-nonapplicator 49222046 Add unevaluted with dynamic ref tests to draft-next 8ba1c90d Update unevaluted with dynamic ref to be more likely to catch errors fea2cf19 add tests for 2019 and 2020 6695ca38 add optional tests for `$ref`ing into known non-applicator keywords 2834c630 Add tests for unevaluated with dynamic reference cda4281c Merge pull request python-jsonschema#695 from json-schema-org/ether/clean-up-subSchemas 7b9f45c2 move subSchemas-defs.json to subSchemas.json e41ec0ec remove unused definition files 349c5a82 Merge pull request #692 from json-schema-org/ether/fix-subSchemas-refs 451baca4 Merge pull request python-jsonschema#670 from marksparkza/invalid-output-test b8da838a Add tests for heterogeneous arrays with additionalItems 6d7a44b7 fix subschema locations and their $refs a9a1e2e3 Merge pull request python-jsonschema#690 from skryukov/add-ipv4-mask-test ba52c48a Merge pull request python-jsonschema#689 from skryukov/add-schema-keyword-to-required-tests 69b53add Add a test case for ipv4 with netmask d0c602a7 Add $schema keyword to required tests 20f1f52c Merge pull request python-jsonschema#688 from spacether/feat_updates_python_exp_impl b087b3ca Updates implmentation 4ecd01f3 Merge pull request python-jsonschema#687 from swaeberle/check-single-label-idn-hostnames 732e7275 test single label IDN hostnames 202d5625 test: hostname format check fails on empty string ea0b63c9 Remove invalid output tests git-subtree-dir: json git-subtree-split: 9ad349be933f1e74810cb4fd3ad19780694dc77e
1 parent ef71f1b commit 56ee673

File tree

169 files changed

+5845
-1697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+5845
-1697
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Validate annotation tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "annotations/**"
7+
8+
jobs:
9+
annotate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Deno
16+
uses: denoland/setup-deno@v2
17+
with:
18+
deno-version: "2.x"
19+
20+
- name: Validate annotation tests
21+
run: deno --node-modules-dir=auto --allow-read --no-prompt bin/annotation-tests.ts

.github/workflows/pr-dependencies.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Check PR Dependencies
2+
3+
on: pull_request
4+
5+
jobs:
6+
check_dependencies:
7+
runs-on: ubuntu-latest
8+
name: Check Dependencies
9+
steps:
10+
- uses: gregsdennis/dependencies-action@main
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Show Specification Annotations
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'tests/**'
7+
8+
jobs:
9+
annotate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Generate Annotations
21+
run: pip install uritemplate && bin/annotate-specification-links

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ To test a specific version:
109109

110110
* 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
111111
* 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
112-
* Load any remote references [described below](additional-assumptions) and configure your implementation to retrieve them via their URIs
112+
* Load any remote references [described below](#additional-assumptions) and configure your implementation to retrieve them via their URIs
113113
* Walk the filesystem tree for that version's subdirectory and for each `.json` file found:
114114

115115
* if the file is located in the root of the version directory:
@@ -159,7 +159,7 @@ If your implementation supports multiple versions, run the above procedure for e
159159
```
160160
161161
2. Test cases found within [special subdirectories](#subdirectories-within-each-draft) may require additional configuration to run.
162-
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).
162+
In particular, when running tests within the `optional/format` subdirectory, test runners should configure implementations to enable format validation, where the implementation supports it.
163163
164164
### Invariants & Guarantees
165165
@@ -227,6 +227,7 @@ This suite is being used by:
227227

228228
### C++
229229

230+
* [Blaze](https://github.com/sourcemeta/blaze)
230231
* [Modern C++ JSON schema validator](https://github.com/pboettch/json-schema-validator)
231232
* [Valijson](https://github.com/tristanpenman/valijson)
232233

@@ -254,12 +255,14 @@ This suite is being used by:
254255

255256
### Java
256257

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

264267
### JavaScript
265268

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

285+
### Kotlin
286+
287+
* [json-schema-validation-comparison](https://www.creekservice.org/json-schema-validation-comparison/functional) (Comparison site for JVM-based validator implementations)
288+
282289
### Node.js
283290

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

288295
### .NET
289296

290-
* [JsonSchema.Net](https://github.com/gregsdennis/json-everything)
297+
* [JsonSchema.Net](https://github.com/json-everything/json-everything)
291298
* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema)
292299

293300
### Perl
@@ -313,7 +320,7 @@ Node-specific support is maintained in a [separate repository](https://github.co
313320
* [fastjsonschema](https://github.com/seznam/python-fastjsonschema)
314321
* [hypothesis-jsonschema](https://github.com/Zac-HD/hypothesis-jsonschema)
315322
* [jschon](https://github.com/marksparkza/jschon)
316-
* [python-experimental, OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python-experimental.md)
323+
* [OpenAPI JSON Schema Generator](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator)
317324

318325
### Ruby
319326

@@ -327,11 +334,13 @@ Node-specific support is maintained in a [separate repository](https://github.co
327334

328335
### Scala
329336

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

332340
### Swift
333341

334342
* [JSONSchema](https://github.com/kylef/JSONSchema.swift)
343+
* [swift-json-schema](https://github.com/ajevans99/swift-json-schema)
335344

336345
If you use it as well, please fork and send a pull request adding yourself to
337346
the list :).

annotations/README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Annotations Tests Suite
2+
3+
The Annotations Test Suite tests which annotations should appear (or not appear)
4+
on which values of an instance. These tests are agnostic of any output format.
5+
6+
## Supported Dialects
7+
8+
Although the annotation terminology of didn't appear in the spec until 2019-09,
9+
the concept is compatible with every version of JSON Schema. Test Cases in this
10+
Test Suite are designed to be compatible with as many releases of JSON Schema as
11+
possible. They do not include `$schema` or `$id`/`id` keywords so
12+
implementations can run the same Test Suite for each dialect they support.
13+
14+
Since this Test Suite can be used for a variety of dialects, there are a couple
15+
of options that can be used by Test Runners to filter out Test Cases that don't
16+
apply to the dialect under test.
17+
18+
## Test Case Components
19+
20+
### description
21+
22+
A short description of what behavior the Test Case is covering.
23+
24+
### compatibility
25+
26+
The `compatibility` option allows you to set which dialects the Test Case is
27+
compatible with. Test Runners can use this value to filter out Test Cases that
28+
don't apply the to dialect currently under test. The terminology for annotations
29+
didn't appear in the spec until 2019-09, but the concept is compatible with
30+
older releases as well. When setting `compatibility`, test authors should take
31+
into account dialects before 2019-09 for implementations that chose to support
32+
annotations for older dialects.
33+
34+
Dialects are indicated by the number corresponding to their release. Date-based
35+
releases use just the year. If this option isn't present, it means the Test Case
36+
is compatible with any dialect.
37+
38+
If this option is present with a number, the number indicates the minimum
39+
release the Test Case is compatible with. This example indicates that the Test
40+
Case is compatible with draft-07 and up.
41+
42+
**Example**: `"compatibility": "7"`
43+
44+
You can use a `<=` operator to indicate that the Test Case is compatible with
45+
releases less then or equal to the given release. This example indicates that
46+
the Test Case is compatible with 2019-09 and under.
47+
48+
**Example**: `"compatibility": "<=2019"`
49+
50+
You can use comma-separated values to indicate multiple constraints if needed.
51+
This example indicates that the Test Case is compatible with releases between
52+
draft-06 and 2019-09.
53+
54+
**Example**: `"compatibility": "6,<=2019"`
55+
56+
For convenience, you can use the `=` operator to indicate a Test Case is only
57+
compatible with a single release. This example indicates that the Test Case is
58+
compatible only with 2020-12.
59+
60+
**Example**: `"compatibility": "=2020"`
61+
62+
### schema
63+
64+
The schema that will serve as the subject for the tests. Whenever possible, this
65+
schema shouldn't include `$schema` or `id`/`$id` because Test Cases should be
66+
designed to work with as many releases as possible.
67+
68+
### externalSchemas
69+
70+
This allows you to define additional schemas that `schema` makes references to.
71+
The value is an object where the keys are retrieval URIs and values are schemas.
72+
Most external schemas aren't self identifying (using `id`/`$id`) and rely on the
73+
retrieval URI for identification. This is done to increase the number of
74+
dialects that the test is compatible with. Because `id` changed to `$id` in
75+
draft-06, if you use `$id`, the test becomes incompatible with draft-03/4 and in
76+
most cases, that's not necessary.
77+
78+
### tests
79+
80+
A collection of Tests to run to verify the Test Case.
81+
82+
## Test Components
83+
84+
### instance
85+
86+
The JSON instance to be annotated.
87+
88+
### assertions
89+
90+
A collection of assertions that must be true for the test to pass.
91+
92+
## Assertions Components
93+
94+
### location
95+
96+
The instance location.
97+
98+
### keyword
99+
100+
The annotating keyword.
101+
102+
### expected
103+
104+
A collection of `keyword` annotations expected on the instance at `location`.
105+
`expected` is an object where the keys are schema locations and the values are
106+
the annotation that schema location contributed for the given `keyword`.
107+
108+
There can be more than one expected annotation because multiple schema locations
109+
could contribute annotations for a single keyword.
110+
111+
An empty object is an assertion that the annotation must not appear at the
112+
`location` for the `keyword`.
113+
114+
As a convention for this Test Suite, the `expected` array should be sorted such
115+
that the most recently encountered value for an annotation given top-down
116+
evaluation of the schema comes before previously encountered values.

annotations/assertion.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
4+
"type": "object",
5+
"properties": {
6+
"location": {
7+
"markdownDescription": "The instance location.",
8+
"type": "string",
9+
"format": "json-pointer"
10+
},
11+
"keyword": {
12+
"markdownDescription": "The annotation keyword.",
13+
"type": "string"
14+
},
15+
"expected": {
16+
"markdownDescription": "An object of schemaLocation/annotations pairs for `keyword` annotations expected on the instance at `location`.",
17+
"type": "object",
18+
"propertyNames": {
19+
"format": "uri"
20+
}
21+
}
22+
},
23+
"required": ["location", "keyword", "expected"]
24+
}

annotations/test-case.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
4+
"type": "object",
5+
"properties": {
6+
"description": {
7+
"markdownDescription": "A short description of what behavior the Test Case is covering.",
8+
"type": "string"
9+
},
10+
"compatibility": {
11+
"markdownDescription": "Set which dialects the Test Case is compatible with. Examples:\n- `\"7\"` -- draft-07 and above\n- `\"<=2019\"` -- 2019-09 and previous\n- `\"6,<=2019\"` -- Between draft-06 and 2019-09\n- `\"=2020\"` -- 2020-12 only",
12+
"type": "string",
13+
"pattern": "^(<=|=)?([123467]|2019|2020)(,(<=|=)?([123467]|2019|2020))*$"
14+
},
15+
"schema": {
16+
"markdownDescription": "This schema shouldn't include `$schema` or `id`/`$id` unless necesary for the test because Test Cases should be designed to work with as many releases as possible.",
17+
"type": ["boolean", "object"]
18+
},
19+
"externalSchemas": {
20+
"markdownDescription": "The keys are retrieval URIs and values are schemas.",
21+
"type": "object",
22+
"patternProperties": {
23+
"": {
24+
"type": ["boolean", "object"]
25+
}
26+
},
27+
"propertyNames": {
28+
"format": "uri"
29+
}
30+
},
31+
"tests": {
32+
"markdownDescription": "A collection of Tests to run to verify the Test Case.",
33+
"type": "array",
34+
"items": { "$ref": "./test.schema.json" }
35+
}
36+
},
37+
"required": ["description", "schema", "tests"]
38+
}

annotations/test-suite.schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
4+
"type": "object",
5+
"properties": {
6+
"description": {
7+
"type": "string"
8+
},
9+
"suite": {
10+
"type": "array",
11+
"items": { "$ref": "./test-case.schema.json" }
12+
}
13+
},
14+
"required": ["description", "suite"]
15+
}

annotations/test.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
4+
"type": "object",
5+
"properties": {
6+
"instance": {
7+
"markdownDescription": "The JSON instance to be annotated."
8+
},
9+
"assertions": {
10+
"markdownDescription": "A collection of assertions that must be true for the test to pass.",
11+
"type": "array",
12+
"items": { "$ref": "./assertion.schema.json" }
13+
}
14+
},
15+
"required": ["instance", "assertions"]
16+
}

0 commit comments

Comments
 (0)