Open-EO / openeo-api

The openEO API specification
http://api.openeo.org
Apache License 2.0
93 stars 12 forks source link

JSON schema for query parameters? #509

Open soxofaan opened 1 year ago

soxofaan commented 1 year ago

I'm a bit confused by the specification of the partial parameter for https://openeo.org/documentation/1.0/developers/api/reference.html#tag/Data-Processing/operation/list-results

image

https://github.com/Open-EO/openeo-api/blob/c5a45b4647b06e313a4f099e9119bfa3cca5c6a3/openapi.yaml#L3238-L3250

How does JSON schema applies to query parameters like this? As far as I know query parameters are just strings and the openEO API spec does not mention something about additional or assumed encoding there.

soxofaan commented 1 year ago

So in the case of partial, the value to enable it should be the string "true" instead of the boolean looking true I think.

Same question applies to other query parameters used in other places, like limit which is defined as int

m-mohr commented 1 year ago

Good question, something that I also recently found weird in OGC APIs. But it's a more general question that should be answered by OpenAPI, I guess?

soxofaan commented 1 year ago

Ah good to know this is an upstream issue.

There is a bit of documentation at https://swagger.io/docs/specification/serialization/ but it does not explicitly mention how basic types like boolean, int and floats are to be encoded and decoded. I know it's quite trivial, but still there are details that could get in the way in practice: e.g. naively serializing boolean "true in Python gives True with capital T instead of true which you would get with Javascript I guess (and I bet there are languages that serialize boolans by default as t/f or even 1/0).

m-mohr commented 1 year ago

Did you find a corresponding issue in the OpenAPI issue tracker? If not, could you open one? Would be interesting to know in general and I'm pretty much flying to NY in a couple of minutes ;-)

soxofaan commented 1 year ago

no, I haven't found any further leads about this. If I find some time today I'll try to create an issue