Open yogat3ch opened 7 months ago
Change main.json to say
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "1.1.0",
"title": "My Main Schema",
"description": "reprex schema",
"type": "object",
"properties": {
"the_object": {
"type": "object",
"properties": {
"my_nested_object": {
"$ref": "objects.json#/properties/objects"
}
}
}
}
}
and validate with
jsonvalidate::json_validate("test.json", "main.json", engine = "ajv")
Several things are going on here that are not great:
./path
to be treated as path
; I've not seen that beforePull requests on any of these welcome, otherwise I'll look at these issues next time we work on the package
Thank you for the tip @richfitz!
What are imjv
specific references and how do they differ from ajv
? I might be able to PR that.
Changing the paths and using ajv
seems to be validating as expected now.
Directory structure is as follows:
main.json:
objects.json:
test.json:
This will always evaluate to
TRUE
, disregarding the mismatch between the values in the array intest_json/the_object/my_nested_object
and theenum
specified in theobjects
reference. It seems like nested objects disregard the specified constraints of referenced schema?