← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1763824] Re: JSON schema validator.nullable doesn't work with ENUMs

 

Reviewed:  https://review.openstack.org/561348
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=78adf4b40fb88e371101ed065ac1d15063d8d86e
Submitter: Zuul
Branch:    master

commit 78adf4b40fb88e371101ed065ac1d15063d8d86e
Author: Morgan Fainberg <morgan.fainberg@xxxxxxxxx>
Date:   Fri Apr 13 13:34:31 2018 -0700

    Fix json schema nullable to add None to ENUM
    
    The JSON Schema validation implementation of nullable(), which makes
    values possible to be null was not adding None to the enum if it exists.
    This causes validation to fail on ``None`` especially in the case of
    keystone's boolean parameter_type implementation. ``nullable()`` now
    adds ``None`` to the enum if the enum exists.
    
    Closes-Bug: #1763824
    Change-Id: I176fa90df63049661413c445554dba9b7d87272a


** Changed in: keystone
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1763824

Title:
  JSON schema validator.nullable doesn't work with ENUMs

Status in OpenStack Identity (keystone):
  Fix Released
Status in OpenStack Identity (keystone) pike series:
  In Progress
Status in OpenStack Identity (keystone) queens series:
  In Progress
Status in OpenStack Identity (keystone) rocky series:
  Fix Released

Bug description:
  JSON Schema validator.nullable only sets null in the types list. This
  works except when an enum is set (such as the case with boolean) [0].

  The fix is to make validator.nullable() smart enough to add to the
  ENUM if ENUM is set as well as type.

  [0]
  https://github.com/openstack/keystone/blob/56237b709ef901fabfd9e8ba744bbcc4cebf8b9b/keystone/common/validation/__init__.py#L33-L43

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1763824/+subscriptions


References