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

Validate for empty query object #39

Closed
keydunov opened this issue Mar 1, 2019 · 4 comments · Fixed by #73
Closed

Validate for empty query object #39

keydunov opened this issue Mar 1, 2019 · 4 comments · Fixed by #73
Labels
good first issue Good for newcomers

Comments

@keydunov
Copy link
Member

keydunov commented Mar 1, 2019

Now, if you pass empty query it will give a weird error. Query needs to be validated.

@paveltiunov paveltiunov added the good first issue Good for newcomers label Mar 1, 2019
@manojown
Copy link
Contributor

manojown commented Apr 1, 2019

@keydunov can you please elaborate this issue like what error you get .

@keydunov
Copy link
Member Author

keydunov commented Apr 1, 2019

@manojown Sure! If one sends a request to Cube.js with empty query params it returns 500 error. I think API gateway should validate the incoming query and return the valid error. Please see the screenshot from Postman with this error -

Screen Shot 2019-04-01 at 12 08 24 PM

@manojown
Copy link
Contributor

manojown commented Apr 2, 2019

@paveltiunov what is better way to do that .
1 . verify empty query object at api gateway level(if query is empty than its avoid all further server execution) ?
OR
2. go through all crash and fix those by some conditions ?

@paveltiunov
Copy link
Member

@manojown Hey Manoj! That's great question! I think it should be on api-gateway level as all validation is done there.

paveltiunov pushed a commit that referenced this issue Apr 6, 2019
* feat:query validation added in api-gateway

* remove redundant call of joi validation which already called by normalizeQuery

Fixes #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants