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

demandé il y a 4 ans473 vues
1 réponse
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.

répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions