gbif / gbif-api

GBIF API
Apache License 2.0
27 stars 5 forks source link

Errors when POST to occurrence/download/request #101

Closed dshorthouse closed 1 year ago

dshorthouse commented 1 year ago

Sending a POST with this document: https://github.com/bionomia/bionomia/blob/master/bionomia_gbif_request.json to https://api.gbif.org/v1/occurrence/download/request

Produces errors such as:

#/predicate: expected: null, found: JSONObject
#/predicate/predicates/2/predicates/1: required key [predicates] not found
#/predicate/predicates/2/predicates/1: extraneous key [predicate] is not permitted
#/predicate/predicates/2/predicates/1/type: not is not a valid enum value
#/predicate/predicates/2/predicates/1: required key [predicates] not found
#/predicate/predicates/2/predicates/1: extraneous key [predicate] is not permitted
#/predicate/predicates/2/predicates/1/type: not is not a valid enum value
#/predicate/predicates/2/predicates/1: required key [key] not found
#/predicate/predicates/2/predicates/1: required key [value] not found
#/predicate/predicates/2/predicates/1: extraneous key [predicate] is not permitted
#/predicate/predicates/2/predicates/1/type: not is not a valid enum value
#/predicate/predicates/2/predicates/1: required key [key] not found
#/predicate/predicates/2/predicates/1: required key [value] not found
etc.

...and the download is not produced. Has the expected structure of the request JSON document changed in the last two weeks?

ManonGros commented 1 year ago

Possibly relates to: https://github.com/gbif/portal-feedback/issues/4525

dshorthouse commented 1 year ago

Possibly relates to: gbif/portal-feedback#4525

Could be related, but I think this one's a different root cause. I had hope to execute a refresh for Bionomia, but will have to wait until I get some feedback if the JSON doc I'm posting no longer works in the way it's constructed.

MattBlissett commented 1 year ago

Hi David,

That is the same error, although on matchCase rather than sendNotification. If you remove the quotes around the true values the request should work.

"matchCase": true

(Otherwise, we should fix the API to accept both ways tomorrow.)

dshorthouse commented 1 year ago

Aha! Of course! Thanks for taking a look.