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

JSON schema for query parameters? #509

Open
soxofaan opened this issue Sep 8, 2023 · 5 comments
Open

JSON schema for query parameters? #509

soxofaan opened this issue Sep 8, 2023 · 5 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Sep 8, 2023

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

openeo-api/openapi.yaml

Lines 3238 to 3250 in c5a45b4

parameters:
- name: partial
description: >-
If set to `true`, the results endpoint returns incomplete results while
still running.
Enabling this parameter requires to indicate the status of the batch job
in the STAC metadata by setting the `openeo:status`.
in: query
allowEmptyValue: true
schema:
type: boolean
default: false

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
Copy link
Member Author

soxofaan commented Sep 8, 2023

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
Copy link
Member

m-mohr commented Sep 8, 2023

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
Copy link
Member Author

soxofaan commented Sep 8, 2023

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
Copy link
Member

m-mohr commented Sep 8, 2023

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
Copy link
Member Author

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

soxofaan added a commit to Open-EO/openeo-python-driver that referenced this issue Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants