cube icon indicating copy to clipboard operation
cube copied to clipboard

Validate for empty query object

Open keydunov opened this issue 7 years ago • 4 comments

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

keydunov avatar Mar 01 '19 15:03 keydunov

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

manojown avatar Apr 01 '19 08:04 manojown

@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

keydunov avatar Apr 01 '19 09:04 keydunov

@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 ?

manojown avatar Apr 02 '19 11:04 manojown

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

paveltiunov avatar Apr 02 '19 14:04 paveltiunov