-
Notifications
You must be signed in to change notification settings - Fork 8
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
Swagger returns status code 500, but the cURL command returns status code 400 #330
Comments
I am pretty sure that it is not a syntax error. This behavior happens for large filters, of which I am confident that the syntax is right. If I make those filters smaller, they work again. |
I updated the given example. |
Maybe the error message implemented in GIScience/oshdb#531 should be return. |
ohsome-api/src/main/lombok/org/heigit/ohsome/ohsomeapi/inputprocessing/InputProcessingUtils.java Line 410 in eb42115
here we need to check if the filter is "normalizable" as the oshdb-api does |
The 400 in the copied curl command is different from the ("expected") 500, because this query filter contains exclamation marks ( The following curl command shows the same (bug) behavior as the main example in the original post: curl -X GET 'https://api.ohsome.org/v1/elements/bbox?bboxes=8.67%2C49.39%2C8.71%2C49.42&clipGeometry=true&filter=(%20(%20highway%20in%20(primary%2Cprimary_link%2Csecondary%2Csecondary_link%2Ctertiary%2Ctertiary_link%2Croad%2Ccycleway%2Cservice%2Cunclassified%2Cresidential%2Cliving_street%2Ctrack)%20or%20route%3Dferry%20)%20and%20maxspeed%20in%20(5%2C10%2C15%2C20%2C25%2C30)%20)%20and%20not%20(%20(%20footway%20in%20(separate%2Cno)%20or%20sidewalk%3Dseparate%20or%20sidewalk%3Aboth%3Dseparate%20or%20(sidewalk%3Aright%3Dseparate%20and%20sidewalk%3Aleft%3Dseparate)%20or%20access%20in%20(no%2Cprivate%2Cpermit%2Cmilitary%2Cdelivery%2Ccustomers)%20or%20foot%20in%20(no%2Cprivate%2Cuse_sidepath%2Cdiscouraged%2Cdestination)%20)%20or%20(%20highway%20in%20(steps%2Ccorridor)%20or%20(highway%3Dpedestrian%20and%20not%20bicycle%20in%20(yes%2Cdesignated)%20and%20(segregated%3Dno%20or%20segregated%3D*)%20)%20or%20railway%3Dplatform%20or%20highway%3Dplatform%20or%20(%20highway%20in%20(footway%2C%20path)%20and%20(%20(%20foot%20in%20(designated%2Cofficial)%20)%20or%20(%20footway%20in%20(access_aisle%2Calley%2Cresidential%2Clink%2Cpath)%20or%20footway!%3D*%20)%20and%20not%20bicycle%20in%20(yes%2Cdesignated)%20and%20(segregated%3Dno%20or%20segregated%3D*)%20)%20and%20motor_vehicle!%3Dyes%20and%20vehicle!%3Dyes%20)%20)%20or%20(%20(%20highway%20in%20(footway%2C%20path)%20and%20(%20foot%20in%20(yes%2Cpermissive%2Cdesignated%2Cofficial)%20or%20footway%20in%20(sidewalk%2Ccrossing%2Ctraffic_island%2Cyes)%20)%20)%20or%20(%20(%20highway%20in%20(primary%2Cprimary_link%2Csecondary%2Csecondary_link%2Ctertiary%2Ctertiary_link%2Croad%2Ccycleway%2Cservice%2Cunclassified%2Cresidential%2Cliving_street%2Ctrack)%20or%20route%3Dferry%20)%20and%20(%20sidewalk%20in%20(both%2Cleft%2Cright%2Cyes%2Clane)%20or%20sidewalk%3Aleft%3Dyes%20or%20sidewalk%3Aright%3Dyes%20or%20sidewalk%3Aboth%3Dyes%20or%20(foot%20in%20(yes%2Cpermissive%2Cdesignated%2Cofficial))%20)%20)%20)%20or%20(%20(%20(%20(%20highway%20in%20(footway%2C%20path)%20and%20(%20foot%20in%20(yes%2Cpermissive%2Cdesignated%2Cofficial)%20or%20footway%20in%20(sidewalk%2Ccrossing%2Ctraffic_island%2Cyes)%20)%20)%20or%20(%20(%20highway%20in%20(primary%2Cprimary_link%2Csecondary%2Csecondary_link%2Ctertiary%2Ctertiary_link%2Croad%2Ccycleway%2Cservice%2Cunclassified%2Cresidential%2Cliving_street%2Ctrack)%20or%20route%3Dferry%20)%20and%20(%20sidewalk%20in%20(both%2Cleft%2Cright%2Cyes%2Clane)%20or%20sidewalk%3Aleft%3Dyes%20or%20sidewalk%3Aright%3Dyes%20or%20sidewalk%3Aboth%3Dyes%20or%20(foot%20in%20(yes%2Cpermissive%2Cdesignated%2Cofficial))%20)%20)%20)%20and%20(%20bicycle%20in%20(yes%2Cdesignated)%20and%20(segregated%3Dno%20or%20segregated%3D*)%20)%20)%20or%20highway%3Dpedestrian%20and%20bicycle%20in%20(yes%2Cdesignated)%20or%20highway%3Dpath%20and%20motor_vehicle!%3Dyes%20and%20vehicle!%3Dyes%20)%20or%20(%20highway%20in%20(living_street%2Ctrack)%20)%20)&properties=tags&time=2016-01-01%2C2017-01-01' -H "accept: application/json" |
instead of iterating through the normalized filter, this checks for the presence of non-snapshot compatible filters by recursively searching through the filter tree.
instead of iterating through the normalized filter, this checks for the presence of non-snapshot compatible filters by recursively searching through the filter tree.
instead of iterating through the normalized filter, this checks for the presence of non-snapshot compatible filters by recursively searching through the filter tree.
fix crash caused by overly complex filters, fixes #330
instead of iterating through the normalized filter, this checks for the presence of non-snapshot compatible filters by recursively searching through the filter tree.
Bug Description
Swagger returns status code 500, but the cURL command copied from the Swagger interface return status code 400.
General Information
Please include the following general information about the issue and list any additional steps needed to reproduce the bug.
1.10.3
]: 1.10.3https://api.ohsome.org/v1
, local instance with an h2 file or connected to the cluster, etc.]: v1Expected Behaviour
Return an invalid filter syntax and status code 400 in Swagger as it does with cURL.
Parameters
Parameters in Swagger are the default ones except the filter.
Filter
Oneliner:
Muliliner:
CURL
The text was updated successfully, but these errors were encountered: