From 2e982fe69ea9df86033555eb1095b49550b7de1a Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 13 Nov 2024 20:26:29 -0400 Subject: [PATCH] Test serving schemas that end with `.schema.json` (#43) Signed-off-by: Juan Cruz Viotti --- test/e2e/common/get.hurl | 11 +++++++++++ test/sandbox/configuration.json | 4 ++++ test/sandbox/manifest-ce.txt | 2 ++ test/sandbox/manifest-ee.txt | 3 +++ .../schemas/example/extension/with.schema.json | 5 +++++ 5 files changed, 25 insertions(+) create mode 100644 test/sandbox/schemas/example/extension/with.schema.json diff --git a/test/e2e/common/get.hurl b/test/e2e/common/get.hurl index 4418ef2..f2c24fe 100644 --- a/test/e2e/common/get.hurl +++ b/test/e2e/common/get.hurl @@ -24,3 +24,14 @@ Link: ; rel="describedby" "$id": "{{base}}/example/v2.0/schema.json", "type": "integer" } + +# .schema.json extension +GET {{base}}/example/extension/with.schema.json +HTTP 200 +Content-Type: application/schema+json +Link: ; rel="describedby" +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "{{base}}/example/extension/with.schema.json", + "type": "string" +} diff --git a/test/sandbox/configuration.json b/test/sandbox/configuration.json index 37195e8..dc834ae 100644 --- a/test/sandbox/configuration.json +++ b/test/sandbox/configuration.json @@ -2,6 +2,10 @@ "url": "http://localhost:8000", "port": 8000, "collections": { + "example/extension": { + "base": "https://example.com/extension", + "path": "./schemas/example/extension" + }, "example/schemas": { "base": "https://example.com/schemas", "path": "./schemas/example/folder" diff --git a/test/sandbox/manifest-ce.txt b/test/sandbox/manifest-ce.txt index 5230305..524fdb6 100644 --- a/test/sandbox/manifest-ce.txt +++ b/test/sandbox/manifest-ce.txt @@ -5,6 +5,8 @@ ./schemas/example ./schemas/example/bundling ./schemas/example/bundling/single.json +./schemas/example/extension +./schemas/example/extension/with.schema.json ./schemas/example/schemas ./schemas/example/schemas/string.json ./schemas/example/v2.0 diff --git a/test/sandbox/manifest-ee.txt b/test/sandbox/manifest-ee.txt index 4ca01ae..996e92b 100644 --- a/test/sandbox/manifest-ee.txt +++ b/test/sandbox/manifest-ee.txt @@ -9,6 +9,9 @@ ./schemas/example/bundling ./schemas/example/bundling/.meta.json ./schemas/example/bundling/single.json +./schemas/example/extension +./schemas/example/extension/.meta.json +./schemas/example/extension/with.schema.json ./schemas/example/schemas ./schemas/example/schemas/.meta.json ./schemas/example/schemas/string.json diff --git a/test/sandbox/schemas/example/extension/with.schema.json b/test/sandbox/schemas/example/extension/with.schema.json new file mode 100644 index 0000000..dcdea26 --- /dev/null +++ b/test/sandbox/schemas/example/extension/with.schema.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://example.com/extension/with.schema.json", + "type": "string" +}