Appsync HTTP resolver supported content types

0

Hi, I'm trying to write an Appsync http resolver mapping template to do a bulk upload to an Elastic Search index using this api: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html

This api expects content type "application/x-ndjson". However, appsync is giving me an error "unsupported content type application/x-ndjson". It appears "application/json" and "application/xml" are supported by appsync, but not sure if any others are

Is the list of supported content types for HTTP resolvers published somewhere? Is there any way I can get around this restriction? I just want the body to be passed through as a string. I don't need it to be parsed or serialized... not sure why the http resolver apparently has a whitelist of acceptable content types.

Thanks, cheers

Edited by: Michael J. Fogel on Dec 9, 2019 8:46 AM

Edited by: Michael J. Fogel on Dec 9, 2019 9:22 AM

gefragt vor 4 Jahren474 Aufrufe
1 Antwort
1

The valid subtypes for the application content type are listed here:
https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-http.html#params-field

I made a code change to allow x-ndjson as well and that should be reflected in a couple of weeks as soon as it gets deployed.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen