diff options
author | Stephen Finucane <stephen@that.guru> | 2022-06-16 15:50:04 +0100 |
---|---|---|
committer | Stephen Finucane <stephenfinucane@hotmail.com> | 2022-06-16 19:32:21 +0200 |
commit | da6c9201b182f00642f493a121578b69535c223b (patch) | |
tree | 2a07313910fb6bd6d91f0891dc8182e1b2339d40 /tests | |
parent | 51b7694c0fedabe6ffff354d0cab91ceec76fabc (diff) | |
download | warlock-da6c9201b182f00642f493a121578b69535c223b.tar.gz |
Add support for jsonschema 4.x
jsonschema 4.0 was released in September 2021. It's time to support it.
Only one issue to address in our tests, namely that when specifying the
'items' key for a property of type 'array', the value should be an
object, not an array of objects.
Good:
{
"type": "object",
"properties": {
"fruits": {
"type": "array",
"items": { "type": "string" }
}
}
}
Bad:
{
"type": "object",
"properties": {
"fruits": {
"type": "array",
"items": [{ "type": "string" }]
}
}
}
The docs say as much [1].
[1] https://json-schema.org/learn/miscellaneous-examples.html#arrays-of-things
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #64
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_core.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index bc36c92..390e61c 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -38,7 +38,7 @@ parent_fixture = { "name": "Parent", "properties": { "name": {"type": "string"}, - "children": {"type": "array", "items": [{"type": "object"}]}, + "children": {"type": "array", "items": {"type": "object"}}, }, "required": ["name", "children"], } |