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"
https://github.com/ManageIQ/manageiq-api/pull/576
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(-)
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