You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When computing a ratio, "Infinity" may be returned in the ratio property. I understand that a division by 0 would lead to this result, but a client application using the Ohsome API expecting a number in that property could crash if the string "Infinity" is returned.
General Information
Please include the following general information about the issue and list any additional steps needed to reproduce the bug.
Version of the ohsome API [e.g. 1.5.0]
1.6.1
Which API instance was requested [e.g. remote instance at https://api.ohsome.org/v1, local instance with an h2 file or connected to the cluster, etc.]
Remote instance at https://api.ohsome.org/v1
Affected endpoint(s) [e.g. /contributions/count]
/elements/area/ratio/groupBy/boundary
URL of your request (and request body if applicable)
The value in the ratio property should conform to the API specification. I see two possible ways of fixing this: a) either not returning "Infinity" at all; or b) define this property using the oneOf keyword of the OpenAPI specification (see https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/).
As an additional issue, the API request uses an invalid value for parameter filter2 (",,GmeKA\x1&x>~X"). Shouldn't the API response be a 400 status code (client error)?
The OpenAPI specification I am referring to is available at:
Bug Description
When computing a ratio,
"Infinity"
may be returned in theratio
property. I understand that a division by 0 would lead to this result, but a client application using the Ohsome API expecting a number in that property could crash if the string"Infinity"
is returned.General Information
Please include the following general information about the issue and list any additional steps needed to reproduce the bug.
1.5.0
]1.6.1
https://api.ohsome.org/v1
, local instance with an h2 file or connected to the cluster, etc.]https://api.ohsome.org/v1
https://api.ohsome.org/v1/elements/area/ratio/groupBy/boundary?keys=highway&types2=line%2Cpolygon%2C&values=platform&showMetadata=no&filter2=%2C%2CGmeKA%5Cx1%26x%3E%7EX&bpolys=C%3A8.704561%2C49.403252%2C8.7074%2C49.422%2C8.74276%2C49.429%2C8.72575%2C49.420%2C8.704561%2C49.403252
Expected Behaviour
The value in the
ratio
property should conform to the API specification. I see two possible ways of fixing this: a) either not returning"Infinity"
at all; or b) define this property using theoneOf
keyword of the OpenAPI specification (see https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/).As an additional issue, the API request uses an invalid value for parameter
filter2
(",,GmeKA\x1&x>~X"
). Shouldn't the API response be a 400 status code (client error)?The OpenAPI specification I am referring to is available at:
Further Information
Error Messages, Logs, Screenshots
See attached screenshot.
Additional Information
A test report revealing this issue is available at the following URL (it might take some time to load):
Screenshot
The text was updated successfully, but these errors were encountered: