Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve responses for bad requests #170

Open
jisantuc opened this issue Mar 16, 2020 · 0 comments
Open

Improve responses for bad requests #170

jisantuc opened this issue Mar 16, 2020 · 0 comments

Comments

@jisantuc
Copy link
Contributor

jisantuc commented Mar 16, 2020

If someone tried to use the API to figure out what was wrong with this request, they'd be completely stuck:

$ echo '{"name": "Test", "jobDefinition": "lol", "validation": {"schema": {}}}' | http :8080/api/models
HTTP/1.1 400 Bad Request
Content-Length: 23
Content-Type: text/plain; charset=UTF-8
Date: Mon, 16 Mar 2020 15:29:04 GMT

Invalid value for: body

You get an identical unhelpful response for bad data types, e.g., if you include jobQueue: 3:

$ echo '{"name": "Test", "jobDefinition": "lol", "jobQueue": 3, "validation": {"schema": {}}}' | http :8080/api/models                                                                 481ms
HTTP/1.1 400 Bad Request
Content-Length: 23
Content-Type: text/plain; charset=UTF-8
Date: Mon, 16 Mar 2020 15:28:24 GMT

Invalid value for: body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant