pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Processes - Unexpected returned value when response='document'

Open francescoingv opened this issue 1 year ago • 0 comments

Description Issuing a synchronous execution request, specifying the response to be 'document', returns a (JSON) string that is different from what is returned when retrieving the 'job-results'

Steps to Reproduce After having set the process manager to be TinyDB in PYGEOAPI_CONFIG issue the following call (note the --verbose flag to get the 'Location'): curl --verbose localhost:5000/processes/hello-world/execution -H 'Content-Type: application/json' -d '{"response": "document", "inputs": {"message": "Message", "name": "My Name"}}' which returns:

[...]
< Location: http://localhost:5000/jobs/5f98b4aa-dbc3-11ee-9007-cdecccd8e112
[...]
{
    "outputs":[
        {
            "id":"echo",
            "value":"Hello My Name! Message"
        }
    ]
}

Then issue the following call: curl http://localhost:5000/jobs/5f98b4aa-dbc3-11ee-9007-cdecccd8e112/results?f=json which returns:

{
    "id": "echo",
    "value": "Hello My Name! Message"
}

Expected behavior Either the first call should return

[...]
< Location: http://localhost:5000/jobs/5f98b4aa-dbc3-11ee-9007-cdecccd8e112
[...]
{
    "id": "echo",
    "value": "Hello My Name! Message"
}

or the second call should return

{
    "outputs":[
        {
            "id":"echo",
            "value":"Hello My Name! Message"
        }
    ]
}

Additional context

If response is not present, or response: "raw", then the result is always

{
    "id": "echo",
    "value": "Hello My Name! Message"
}

francescoingv avatar Mar 06 '24 14:03 francescoingv