unreasonable error message returned when an empty body was posted to POST request
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Won't Fix
|
Low
|
Kent Wang |
Bug Description
For now, if a POST request with an empty body, the bad request message will return a code-level error info, this is unfriendly to end users.
The curl request of a POST request with a empty body:
curl -g -i --cacert "/opt/stack/
the return message:
{"error": {"message": "create_user() takes exactly 3 arguments (2 given)", "code": 400, "title": "Bad Request"}}
The others keystone API has the same issue.
the reasonable return of a this type request is like this:
curl -g -i --cacert "/opt/stack/
{"badRequest": {"message": "Missing required element 'volume' in request body", "code": 400}}
Changed in keystone: | |
assignee: | nobody → Liusheng (liusheng) |
tags: | added: user-experience |
Changed in keystone: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in keystone: | |
assignee: | Liusheng (liusheng) → nobody |
Changed in keystone: | |
assignee: | nobody → Kent Wang (k.wang) |
tags: | added: validation |
We have schema validation for v3 API, but don't apply the schema validation to v2 API, consider that v2 API has been deprecated there might be no such urgent requirement to enforce schema validation to v2 API.
In my point of view, this is a generic issue for v2 api instead of user specific.
So, either check the argument within each API or enforce schema validation to v2 API.