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

How to use Search mappings endpoint? #81

Open
ramiromagno opened this issue Oct 16, 2023 · 0 comments
Open

How to use Search mappings endpoint? #81

ramiromagno opened this issue Oct 16, 2023 · 0 comments

Comments

@ramiromagno
Copy link

Hi OXO team,

How to use the Search Mappings endpoint?

I can't seem to understand how to use these other parameters.

This is the only example provided in the documentation:

curl 'https://www.ebi.ac.uk/spot/oxo/api/search' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "ids" : [ "DOID:162" ],
  "inputSource" : null,
  "mappingTarget" : [ "MONDO" ],
  "mappingSource" : [ "MONDO" ],
  "distance" : 1
}'

How to use the inputSource parameter? Can mappingTarget or mappingSource be null? I am getting bad requests when I do such combinations. It would be helpful if you could provide at least one example per combination. Also, the bad request messages are not useful:

curl 'https://www.ebi.ac.uk/spot/oxo/api/search' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
                         "ids" : null,
                         "inputSource" : [ "EFO" ],
                         "mappingTarget" : [ "MONDO" ],
                         "mappingSource" : [ "MONDO" ],
                         "distance" : 1
                       }'
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Strict-Transport-Security: max-age=0
Date: Mon, 16 Oct 2023 21:21:27 GMT
X-Application-Context: application
Expires: 0
X-XSS-Protection: 1; mode=block
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
Connection: close
X-Frame-Options: DENY

{"timestamp":1697491287674,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"Could not read document: Can not deserialize instance of java.lang.String out of START_ARRAY token\n at [Source: java.io.PushbackInputStream@4a8e2b98; line: 3, column: 19] (through reference chain: uk.ac.ebi.spot.model.MappingSearchRequest[\"inputSource\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_ARRAY token\n at [Source: java.io.PushbackInputStream@4a8e2b98; line: 3, column: 19] (through reference chain: uk.ac.ebi.spot.model.MappingSearchRequest[\"inputSource\"])","path":"/spot/oxo/api/search"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant