Skip to content

Commit

Permalink
Support relative base URIs
Browse files Browse the repository at this point in the history
See: sourcemeta/jsonschema#185
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
  • Loading branch information
jviotti committed Nov 4, 2024
1 parent 9edbfae commit e151420
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/evaluator/evaluator_draft4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5658,3 +5658,23 @@ TEST(Evaluator_draft4, ref_to_non_schema) {
FAIL();
}
}

TEST(Evaluator_draft4, relative_base_uri_with_ref) {
const sourcemeta::jsontoolkit::JSON schema{
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-04/schema",
"id": "common",
"allOf": [ { "$ref": "#reference" } ],
"definitions": {
"reference": {
"id": "#reference",
"type": "string"
}
}
})JSON")};

const sourcemeta::jsontoolkit::JSON instance{"test"};
EVALUATE_WITH_TRACE_FAST_SUCCESS(schema, instance, 1);

// TODO: Assert on traces
}

0 comments on commit e151420

Please sign in to comment.