Skip to content

Commit

Permalink
Turn absolute references into relative references when possible (#89)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Jan 7, 2025
1 parent 909f403 commit fbf47fc
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
vendorpull https://github.com/sourcemeta/vendorpull dea311b5bfb53b6926a4140267959ae334d3ecf4
noa https://github.com/sourcemeta/noa 924f5cc8549af7f12227869dcbab4259029ac650
jsontoolkit https://github.com/sourcemeta/jsontoolkit 30bdbfd3dc94a3329e3c76224f360525c9645bc4
jsontoolkit https://github.com/sourcemeta/jsontoolkit 0073e1e712ecd6634163d7c7c83afeb6c5cfbe82
blaze https://github.com/sourcemeta/blaze bde17029b8fc8daf38a496d4d27354a4d24b3530
hydra https://github.com/sourcemeta/hydra 1f958f97d578ece9984a09065a53d317976ae2da
bootstrap https://github.com/twbs/bootstrap v5.3.3
Expand Down
9 changes: 9 additions & 0 deletions test/e2e/common/get.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ HTTP 200
]
}

# With absolute references
GET {{base}}/example/schemas/absolute-refs.json
HTTP 200
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "{{base}}/example/schemas/absolute-refs.json",
"$ref": "string.json"
}

# Folder with period
GET {{base}}/example/v2.0/schema.json
HTTP 200
Expand Down
1 change: 1 addition & 0 deletions test/sandbox/manifest-ce.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
./schemas/example/extension
./schemas/example/extension/with.schema.json
./schemas/example/schemas
./schemas/example/schemas/absolute-refs.json
./schemas/example/schemas/camelcase.json
./schemas/example/schemas/no-id-draft7-ref.json
./schemas/example/schemas/no-id.json
Expand Down
1 change: 1 addition & 0 deletions test/sandbox/manifest-ee.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
./schemas/example/extension
./schemas/example/extension/with.schema.json
./schemas/example/schemas
./schemas/example/schemas/absolute-refs.json
./schemas/example/schemas/camelcase.json
./schemas/example/schemas/no-id-draft7-ref.json
./schemas/example/schemas/no-id.json
Expand Down
5 changes: 5 additions & 0 deletions test/sandbox/schemas/example/folder/absolute-refs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/absolute-refs.json",
"$ref": "https://example.com/schemas/string.json"
}
3 changes: 2 additions & 1 deletion vendor/jsontoolkit/src/jsonschema/CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions vendor/jsontoolkit/src/jsonschema/relativize.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions vendor/jsontoolkit/src/jsonschema/resolver.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbf47fc

Please sign in to comment.