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

Inconsistent fields in error responses #288

Open
matthiasschaub opened this issue Dec 14, 2022 · 0 comments
Open

Inconsistent fields in error responses #288

matthiasschaub opened this issue Dec 14, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@matthiasschaub
Copy link
Contributor

Bug Description

Different error have different response structures (JSON fields).

General Information

curl -X GET "https://api.ohsome.org/v1/elements/lengh?bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=waterway%20in%20(river%2C%20canal%2C%20stream%2C%20drain%2C%20ditch)%20and%20geometry%3Alie&format=json&time=2014-01-01%2F2017-01-01%2FP1Y" -H  "accept: application/json"
{
  "timestamp" : "2022-12-14T11:54:25.412+00:00",
  "status" : 404,
  "error" : "Not Found",
  "path" : "/elements/lengh"
}
curl -X GET "https://api.ohsome.org/v1/elements/length?bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=waterway%20in%20(river%2C%20canal%2C%20stream%2C%20drain%2C%20ditch)%20and%20geometry%3Alien&format=json&time=2014-01-01%2F2017-01-01%2FP1Y" -H  "accept: application/json"
{
  "timestamp" : "2022-12-14T11:55:02.834561",
  "status" : 400,
  "message" : "Invalid filter syntax. Please look at the additional info and examples about the filter parameter at https://docs.ohsome.org/ohsome-api. Detailed error message: line 1, column 67: whitespaces, EQUALS (=), NOT_EQUALS (!=) or in expected, EOF encountered.",
  "requestUrl" : "https://api.ohsome.org/v1/elements/length?bboxes=8.67%2C49.39%2C8.71%2C49.42&filter=waterway%20in%20(river%2C%20canal%2C%20stream%2C%20drain%2C%20ditch)%20and%20geometry%3Alien&format=json&time=2014-01-01%2F2017-01-01%2FP1Y"

Expected Behaviour

Both responses should contain the same fields (i.e. both should have the "message" field or "error" field)

@matthiasschaub matthiasschaub added the bug Something isn't working label Dec 14, 2022
@tyrasd tyrasd added this to the 2.0 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants