← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1652719] [NEW] The JSON-Schema of string integer can't handle the case of empty string

 

Public bug reported:

The schema of string integer didn't handle the case of empty string

https://github.com/openstack/nova/blob/master/nova/api/validation/parameter_types.py#L186

positive_integer = {
    'type': ['integer', 'string'],
    'pattern': '^[0-9]*$', 'minimum': 1
}


non_negative_integer = {
    'type': ['integer', 'string'],
    'pattern': '^[0-9]*$', 'minimum': 0
}


There is no limit on the length of string. So the user can input a empty string. When I input empty string, the nova api return 500.

The affected APIs are:
1. create_backup
2. server create with multiple create
3. networks
4. tenant_networks

** Affects: nova
     Importance: Medium
     Assignee: Alex Xu (xuhj)
         Status: In Progress

** Project changed: ironic => nova

** Changed in: nova
     Assignee: (unassigned) => Alex Xu (xuhj)

** Changed in: nova
       Status: New => Confirmed

** Changed in: nova
   Importance: Undecided => Medium

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

Title:
  The JSON-Schema of string integer can't handle the case of empty
  string

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  The schema of string integer didn't handle the case of empty string

  https://github.com/openstack/nova/blob/master/nova/api/validation/parameter_types.py#L186

  positive_integer = {
      'type': ['integer', 'string'],
      'pattern': '^[0-9]*$', 'minimum': 1
  }

  
  non_negative_integer = {
      'type': ['integer', 'string'],
      'pattern': '^[0-9]*$', 'minimum': 0
  }

  
  There is no limit on the length of string. So the user can input a empty string. When I input empty string, the nova api return 500.

  The affected APIs are:
  1. create_backup
  2. server create with multiple create
  3. networks
  4. tenant_networks

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


Follow ups