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

preguntada hace 4 años473 visualizaciones
1 Respuesta
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.

respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas