From acf7a6b4ed7824cbb7daf9d19942c24fec33e848 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 30 May 2023 16:02:40 -0400 Subject: [PATCH] Squashed 'json/' changes from 6afa9b38d..b069ac352 b069ac352 Add tests for non-relative URI anchor referencing 7950d9e05 Merge pull request #674 from jmigual/feature/alah e6a089ae9 Changed description about `main` branch b3c074773 Add comment about live at head philosophy ab4bd012f Merge pull request #671 from marksparkza/schemaloc-fragment e7aba0972 Include fragment in schemaLocation git-subtree-dir: json git-subtree-split: b069ac352c3dc1fae71f6f177dafe97001c97920 --- README.md | 2 ++ output-tests/draft-next/content/general.json | 2 +- output-tests/draft-next/content/readOnly.json | 2 +- output-tests/draft-next/content/type.json | 2 +- tests/draft6/ref.json | 27 +++++++++++++++++++ tests/draft7/ref.json | 27 +++++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 36dda742..cdd5dc8a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ This repository contains a set of JSON objects that implementers of JSON Schema It is meant to be language agnostic and should require only a JSON parser. The conversion of the JSON objects into tests within a specific language and test framework of choice is left to be done by the validator implementer. +The recommended workflow of this test suite is to clone the `main` branch of this repository as a `git submodule` or `git subtree`. The `main` branch is always stable. + ## Coverage All JSON Schema specification releases should be well covered by this suite, including drafts 2020-12, 2019-09, 07, 06, 04 and 03. diff --git a/output-tests/draft-next/content/general.json b/output-tests/draft-next/content/general.json index 27082ed6..23fe1dae 100644 --- a/output-tests/draft-next/content/general.json +++ b/output-tests/draft-next/content/general.json @@ -20,7 +20,7 @@ "contains": { "properties": { "evaluationPath": {"const": ""}, - "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/general/0"}, + "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/general/0#"}, "instanceLocation": {"const": ""}, "annotations": false, "droppedAnnotations": { diff --git a/output-tests/draft-next/content/readOnly.json b/output-tests/draft-next/content/readOnly.json index d387d932..8d1c2dec 100644 --- a/output-tests/draft-next/content/readOnly.json +++ b/output-tests/draft-next/content/readOnly.json @@ -19,7 +19,7 @@ "contains": { "properties": { "evaluationPath": {"const": ""}, - "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/readOnly/0"}, + "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/readOnly/0#"}, "instanceLocation": {"const": ""}, "annotations": { "properties": { diff --git a/output-tests/draft-next/content/type.json b/output-tests/draft-next/content/type.json index e17f1f53..afc7f5fd 100644 --- a/output-tests/draft-next/content/type.json +++ b/output-tests/draft-next/content/type.json @@ -19,7 +19,7 @@ "contains": { "properties": { "evaluationPath": {"const": ""}, - "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/type/0"}, + "schemaLocation": {"const": "https://json-schema.org/tests/content/draft-next/type/0#"}, "instanceLocation": {"const": ""}, "annotations": false, "errors": { diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json index 8a8908a4..379322c7 100644 --- a/tests/draft6/ref.json +++ b/tests/draft6/ref.json @@ -445,6 +445,33 @@ } ] }, + { + "description": "Reference an anchor with a non-relative URI", + "schema": { + "$id": "https://example.com/schema-with-anchor", + "allOf": [{ + "$ref": "https://example.com/schema-with-anchor#foo" + }], + "definitions": { + "A": { + "$id": "#foo", + "type": "integer" + } + } + }, + "tests": [ + { + "data": 1, + "description": "match", + "valid": true + }, + { + "data": "a", + "description": "mismatch", + "valid": false + } + ] + }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { diff --git a/tests/draft7/ref.json b/tests/draft7/ref.json index 82631726..82e1e167 100644 --- a/tests/draft7/ref.json +++ b/tests/draft7/ref.json @@ -445,6 +445,33 @@ } ] }, + { + "description": "Reference an anchor with a non-relative URI", + "schema": { + "$id": "https://example.com/schema-with-anchor", + "allOf": [{ + "$ref": "https://example.com/schema-with-anchor#foo" + }], + "definitions": { + "A": { + "$id": "#foo", + "type": "integer" + } + } + }, + "tests": [ + { + "data": 1, + "description": "match", + "valid": true + }, + { + "data": "a", + "description": "mismatch", + "valid": false + } + ] + }, { "description": "Location-independent identifier with base URI change in subschema", "schema": {