← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1655710] Re: Query parameter validation using json schema - error messages

 

Reviewed:  https://review.openstack.org/465785
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5e51fed4a0f75ec6c97cd2582d89584b9364ccfc
Submitter: Jenkins
Branch:    master

commit 5e51fed4a0f75ec6c97cd2582d89584b9364ccfc
Author: He Jie Xu <hejie.xu@xxxxxxxxx>
Date:   Thu May 18 10:52:54 2017 +0800

    Correct the error message for query parameter validation
    
    Currently the error message returned by failed query parameter validation
    didn't include correct parameter name. This patch correct that.
    
    Change-Id: Ifd0b37084709c2728749b5b7b317f304b0488269
    Closes-Bug: #1655710


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

-- 
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/1655710

Title:
  Query parameter validation using json schema - error messages

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  A mechanism to validate query parameters using json schema was added
  in the following series:

      https://review.openstack.org/#/q/topic:bp/consistent-query-
  parameters-validation

  The resulting error messages aren't very user friendly though. For
  example, if you pass an invalid limit to os-keypairs list, you used to
  get a custom message rather than the obscure message generated by json
  schema.

  Before:

      webob.exc.HTTPBadRequest: Invalid input received: limit must be an
  integer

  After:

      nova.exception.ValidationError: Invalid input for query parameters
  0. Value: abc. u'abc' does not match '^[0-9]*$'

  The exception raised also changed, which may be problematic for API
  consumers.

  We probably need another layer to transform these generated messages
  into something more user friendly, and perhaps consider raising
  HTTPBadRequest again with the nicer error message.

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


References