Allow direct JSON value, e.g. 5.0, as equivalent to { "value" : 5.0 }
jerstlouis opened this issue · comments
As part of discussions to harmonize OGC API - Routes with Processes, it was identified that the requirement to specify an input value as an object with a "value" key makes a lot of noise reducing the legibility of the request.
The same argument is actually also true for any process execution request where no other attribute are necessary to be specified alongside the value, as is often the case with most parameters fixed for the execution request.
I am proposing here that a direct value (e.g. a number or text string) be equivalent to a spelled out { "value" : <value> }
. This should be simple for text, integer, real, boolean and arrays, but might be trickier with objects. Objects might be an exception where they always must use the { "value" : { ... } }
syntax.
At the 2021-03-26 Routing SWG, it was agreed to coordinate between Routes and Processes for this potential full harmonization, with feedback from Routes to be provided by mid-April.
Practical example:
{
"process" : "http://localhost:8080/ogcapi/processes/PCGridify",
"inputs" : {
"data" : { "collection" : "http://localhost:8080/ogcapi/collections/Quebec-LiDAR" },
"output" : "rgb",
"fillDistance" : 7,
"classes" : [ "lowVegetation", "mediumVegetation", "highVegetation" ]
}
}
instead of:
{
"process" : "http://localhost:8080/ogcapi/processes/PCGridify",
"inputs" : {
"data" : { "collection" : "http://localhost:8080/ogcapi/collections/Quebec-LiDAR" },
"output" : { "value" : "rgb" },
"fillDistance" : { "value" : 7 },
"classes" : [
{ "value" : "lowVegetation" },
{ "value" : "mediumVegetation" },
{ "value" : "highVegetation" }
]
}
}
Should be fixed by #156