Closed soxofaan closed 2 years ago
background story:
condition=false
, e.g. https://github.com/Open-EO/openeo-python-client/blob/d608d44f36954540f208a9e699cfc1b2e7a7fad1/tests/rest/datacube/test_processbuilder.py#L687false is not allowed as input value according to the spec. The part that is defining that is "const: true" in the boolean schema. That means false must be rejected right now (comparable to an integer value with constraint "minimum: 0", which would also reject all values < 0).
Honestly, I regret defining the condition parameter as it is right now. It should have been defined in at least two processes:
That would have been more straightforward. Or I should have used string values instead of the null/false "mis-use". It's just not very intuitive.
false is not allowed as input value according to the spec. The part that is defining that is "const: true" in the boolean schema.
Indeed, I see that from the spec in JSON, but the docs are misleading, because they say "boolean" in general
And apart from that it is very confusing on itself (as you note yourself), that value true
is allowed, but false
is not
Yes, but that is normal behavior in programming language signatures?! It just lists the types/classes without value constraints, otherwise you'd also need to list all other constraints in the signature, e.g. min and max values for numbers or allowed string values for strings.
I understand, it's just very weird to see "boolean" as type, but false
is illegal.
Also note that the representation of these union schema's (I don't know the correct terminology) in the docs is pretty obscure. Because I've been already exposed to a bit of JSON schema, I kind of get it, but I wonder what the less-initiated user makes from this visual structure:
Anyway, I think we should add an explicit note in the docs that false
is (currently) not supported
Also note that the representation of these union schema's (I don't know the correct terminology) in the docs is pretty obscure.
Yes, I agree. Please open an issue in openeo-vue-components with suggestions and we can try to improve it.
ToDo:
false
is not allowed.Please open an issue in openeo-vue-components with suggestions and we can try to improve it.
Is that something we have much control over? I thought this just part of the doc building tool
That is something we have control over, the doc building tool is based on the openEO vue components and is developed by me :-)
:laughing: I didn't know that, I assumed we were using an off-the-shelf OpenAPI doc generation tool
Yes, we do. For the API. But our processes have nothing to do with OpenAPI. :-) The processes are something custom in mainly JSON Schema. The DocGen for the Processes ist just a slightly extended version of the Process(es) Vue Component that we also use in the Web Editor etc.
https://github.com/Open-EO/openeo-processes/blob/d0ce91fcd347360b907ea2d9589d7564a2c1e1e3/count.json#L56-L64
count
supports, apart from a full process graph, two special values forcondition
:null
as shortcut foris_valid
true
as shortcut for count allThe schema of
condition
in the docs at e.g. https://processes.openeo.org/#count sayWhich also include the boolean value
false
, but its is undefined in the docs.possible definitions:
true
)