diff --git a/ironic/api/controllers/v1/network-data-schema.json b/ironic/api/controllers/v1/network-data-schema.json index 7162daf343..c27c848715 100644 --- a/ironic/api/controllers/v1/network-data-schema.json +++ b/ironic/api/controllers/v1/network-data-schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://openstack.org/nova/network_data.json#", + "$schema": "http://json-schema.org/draft-07/schema#", "id": "http://openstack.org/nova/network_data.json", "type": "object", "title": "OpenStack Nova network metadata schema", diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py index f182e2fd28..2ef369e136 100644 --- a/ironic/api/controllers/v1/node.py +++ b/ironic/api/controllers/v1/node.py @@ -140,6 +140,7 @@ def network_data_schema(): def node_schema(): network_data = network_data_schema() return { + '$schema': 'http://json-schema.org/draft-07/schema#', 'type': 'object', 'properties': { 'automated_clean': {'type': ['string', 'boolean', 'null']}, diff --git a/ironic/tests/unit/api/controllers/v1/test_deploy_template.py b/ironic/tests/unit/api/controllers/v1/test_deploy_template.py index b86fb0b1df..63784fef32 100644 --- a/ironic/tests/unit/api/controllers/v1/test_deploy_template.py +++ b/ironic/tests/unit/api/controllers/v1/test_deploy_template.py @@ -883,7 +883,7 @@ class TestPost(BaseDeployTemplatesAPITest): def test_create_invalid_step_field_priority(self): self._test_create_invalid_step_field( 'priority', 'not a number', - "'not a number' is not of type 'integer'") + "'not a number'") # differs between jsonschema versions def test_create_invalid_step_field_negative_priority(self): self._test_create_invalid_step_field( diff --git a/releasenotes/notes/jsonschema-966f55fc79b916fc.yaml b/releasenotes/notes/jsonschema-966f55fc79b916fc.yaml new file mode 100644 index 0000000000..20c1f7247e --- /dev/null +++ b/releasenotes/notes/jsonschema-966f55fc79b916fc.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Fixes compatibility with ``jsonschema`` package version 4.0.0 or newer + by providing a proper schema version (Draft-07 currently). +issues: + - | + When using ``jsonschema`` 4.0.0 or newer, make sure to include a proper + ``$schema`` field in your custom network data or RAID schemas.