oneOf keyword wrongly used in schema

Bug #1843568 reported by Michal Skalski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-net-config
Fix Released
Undecided
Michal Skalski

Bug Description

Looking at the schema I see two problems with usage of oneOf keyword:

1) When 'oneOf' keyword is used data must be valid against exactly one of the given subschemas [1]. There are examples when both of subschemas refer to param defintion [2] which means that data is valid against more than one schema from 'oneOf'. In that case 'anyOf' should be used [3].

2) There are occurence of 'oneof' keyword (all letters lowercase) [4] which does not enforce anything.

[1] https://json-schema.org/understanding-json-schema/reference/combining.html#oneof
[2] https://github.com/openstack/os-net-config/blob/master/os_net_config/schema.yaml#L155-L158
[3] https://json-schema.org/understanding-json-schema/reference/combining.html#anyof
[4] https://github.com/openstack/os-net-config/blob/master/os_net_config/schema.yaml#L822-L824

Changed in os-net-config:
assignee: nobody → Michal Skalski (mskalski)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-net-config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/681447

Changed in os-net-config:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-net-config (master)

Reviewed: https://review.opendev.org/681447
Committed: https://git.openstack.org/cgit/openstack/os-net-config/commit/?id=827587382ef82a8cfcb0d831ae3c3af123364d08
Submitter: Zuul
Branch: master

commit 827587382ef82a8cfcb0d831ae3c3af123364d08
Author: Michal Skalski <email address hidden>
Date: Wed Sep 11 13:31:16 2019 +0200

    Fix usage of oneOf keyword in schema

    Replace 'oneOf' keyword with 'anyOf' when data match more than one subschema.
    Replace 'oneof' with 'oneOf' as it is proper keyword.

    Change-Id: I0f8258ad102e01051ba0c736442f05bd6e4654d2
    Closes-Bug: 1843568

Changed in os-net-config:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-net-config 11.3.0

This issue was fixed in the openstack/os-net-config 11.3.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.