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

ETS expects unquoted strings while using Accept: application/json #55

Closed
jerstlouis opened this issue Feb 12, 2023 · 5 comments · Fixed by #76
Closed

ETS expects unquoted strings while using Accept: application/json #55

jerstlouis opened this issue Feb 12, 2023 · 5 comments · Fixed by #76
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@jerstlouis
Copy link
Member

Describe the bug
It seems that the ETS expects single value raw text outputs as unquoted strings, however it uses an Accept: header with application/json for making this request. This is inconsistent and causes compatibility problems with trying to respect OGC API Web Guidelines 10 - Flexible content negotiation and upcoming version 2.0.

Expected behavior
If unquoted text values are expected, Accept: text/plain (for text) or application/octet-stream (for binary data) should be used (or at least not including an Accept: header at all).

@dstenger dstenger added this to To do in CITE via automation Jul 27, 2023
@dstenger dstenger moved this from To do to In progress in CITE Jul 27, 2023
@bpross-52n bpross-52n mentioned this issue Aug 9, 2023
@dstenger dstenger added the bug Something isn't working label Aug 10, 2023
@bpross-52n
Copy link
Collaborator

@jerstlouis I have created a fix for this (see #76). Could you maybe provide a test endpoint, so I can verify my fix?

@jerstlouis
Copy link
Member Author

jerstlouis commented Aug 10, 2023

@bpross-52n We were testing this with our EchoProcess at https://maps.gnosis.earth/ogcapi/processes/echo

If this was preventing the ETS to pass, we might have set up a work-around to pass the compliance test.
Which way was this fixed? Using Accept: text/plain or expecting string raw text outputs as quoted when requesting with Accept: application/json?

Right now POSTing to https://maps.gnosis.earth/ogcapi/processes/echo/execution:

{
  "process" : "https://maps.gnosis.earth/ogcapi/processes/echo",
  "inputs" : {
    "stringInput" : "Value1"
  },
  "response": "raw"
}

will return the string unquoted whether using Accept: application/json or not, as a result of that work-around.

If the fix is for the ETS to not use application/json, then that could be verified in the requests that is sent out.

Note that this is somewhat related to #60 (still open) and #61 (fixed?) whereas the number of outputs and the "raw" behavior will change depending on what outputs are to be returned.

@bpross-52n
Copy link
Collaborator

@jerstlouis We fixed it by leaving out the Accept header and then checking if the result contains the string input.

@dstenger dstenger moved this from In progress to To verify in CITE Sep 7, 2023
@dstenger dstenger assigned dstenger and unassigned bpross-52n Sep 7, 2023
@dstenger dstenger assigned bpross-52n and unassigned dstenger Nov 8, 2023
@dstenger dstenger moved this from To verify to In progress in CITE Nov 8, 2023
@dstenger dstenger moved this from In progress to To verify in CITE Dec 14, 2023
@dstenger dstenger assigned dstenger and unassigned bpross-52n Dec 14, 2023
@dstenger dstenger added this to the 1.1 milestone Dec 14, 2023
@bpross-52n
Copy link
Collaborator

@gfenoy I have created a pull request to fix this issue. However, the status document of the finished job returns the following link:

 {
    "title" : "Result location",
    "rel" : "results",
    "type" : "application/json",
    "href" : "http://.../results"
  }

Imho, the relation should be http://www.opengis.net/def/rel/ogc/1.0/results, see here: https://docs.ogc.org/is/18-062r2/18-062r2.html#toc16
Would you agree?

CITE automation moved this from To verify to Done Dec 14, 2023
dstenger added a commit that referenced this issue Dec 14, 2023
@gfenoy
Copy link
Contributor

gfenoy commented Dec 14, 2023

@gfenoy I have created a pull request to fix this issue. However, the status document of the finished job returns the following link:

 {
    "title" : "Result location",
    "rel" : "results",
    "type" : "application/json",
    "href" : "http://.../results"
  }

Imho, the relation should be http://www.opengis.net/def/rel/ogc/1.0/results, see here: https://docs.ogc.org/is/18-062r2/18-062r2.html#toc16 Would you agree?

I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
CITE
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants