Bug 1698193 - Missing resource error message poorly worded
Summary: Missing resource error message poorly worded
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: GA
: 5.11.0
Assignee: Joe Vlcek
QA Contact: Md Nadeem
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-09 19:03 UTC by Joe Vlcek
Modified: 2020-04-27 10:52 UTC (History)
4 users (show)

Fixed In Version: 5.11.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-12 13:36:21 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:4199 0 None None None 2019-12-12 13:36:35 UTC

Description Joe Vlcek 2019-04-09 19:03:38 UTC
Description of problem:
When a required field is omitted from an API request the working of the
resulting error message is poorly structured.

How Reproducible:

Always

Steps to Reproduce:

Issue an API POST without specifying a required resource field.
e.g.:
Issue the following API POST without specifying the required "mode" or "description" resource field:

curl -k --user admin:<pw> -i -X  POST -H "Content-Type: application/json" -H "Accept: application/json" -d ' { "resources": [{ "description": "none" }] }' https://<my-appliance>/api/alert_definition_profiles

Actual results:

Note the poor wording of the resulting error message:
{"error":{"kind":"bad_request","message":"Resource mode needs be specified for creating a new alert_definition_profiles","klass":"Api::BadRequestError"}}


Expected results:

A properly worded error message.

e.g.:

"Resource mode must be specified when creating a new alert_definition_profiles"

Comment 3 CFME Bot 2019-04-09 21:27:29 UTC
New commit detected on ManageIQ/manageiq-api/master:

https://github.com/ManageIQ/manageiq-api/commit/d52bbb29d583e9befc3e1c82ef827ce6967fe690
commit d52bbb29d583e9befc3e1c82ef827ce6967fe690
Author:     Joe VLcek <jvlcek>
AuthorDate: Tue Apr  9 16:43:58 2019 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Tue Apr  9 16:43:58 2019 -0400

    Fix poor wording on missing resource error message.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1698193

 app/controllers/api/base_controller/parser.rb | 2 +-
 spec/requests/policies_spec.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comment 6 errata-xmlrpc 2019-12-12 13:36:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4199


Note You need to log in before you can comment on or make changes to this bug.