You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fails with an error when trying to decode the response from the server: this is an API-side bug. The API should be returning JSON error messages even when the query results in a 500 error because Elasticsearch can't run the query.
Doing the JSON conversion outside of httr::POST with jsonlite::toJSON(, auto_unbox=FALSE) works but also results in single element arguments to parameters that expect a list eg fields. fields_exclude, and top_fields, to be a string instead of a list which the API fails on. Catch-22.
Alex is looking at changing the API behaviour to allow for both strings and single item lists as arguments because Elasticsearch already behaves this way in a number of places to it won't feel inconsistent.
(Ref another solution on the R side, maintain a list of everything that has to be list and fixup the object prior to JSON encoding with appropriate calls to I() : jeroen/jsonlite#78 )
Alex has adjusted the API to allow for mixed single item list and strings for API parameters. Now have unboxing on so things that get passed through to Elasticsearch meet ES's expectations.
df = idig_search_records(rq=list("scientificname"=list("type"="missing")))
This search is encoded as
?rq={"scientificname":{"type":["missing"]}}
which has the"missing"
as a list. See this jsonlite ticket:jeroen/jsonlite#73
Fails with an error when trying to decode the response from the server: this is an API-side bug. The API should be returning JSON error messages even when the query results in a 500 error because Elasticsearch can't run the query.
Ref: iDigBio/idigbio-search-api#2
The text was updated successfully, but these errors were encountered: