x-amazon-apigateway-integration.responseTemplates-Objekt - Amazon API Gateway

x-amazon-apigateway-integration.responseTemplates-Objekt

Gibt die Mapping-Vorlagen für eine Antwortnutzlast der angegebenen MIME-Typen an.

Eigenschaften
Name der Eigenschaft Typ Beschreibung
MIME type string

Gibt eine Mapping-Vorlage an, um den Integrationsantworttext für einen bestimmten MIME-Typ in den Methodenantworttext umzuwandeln. Weitere Informationen zum Erstellen einer Mapping-Vorlage finden Sie unter PetStore-Zuweisungsvorlage. Ein Beispiel für den MIME-Typ ist application/json.

x-amazon-apigateway-integration.responseTemplate-Beispiel

Im folgenden Beispiel werden Mapping-Vorlagen für eine Anforderungsnutzlast der application/json- und application/xml-MIME-Typen festgelegt.

"responseTemplates" : { "application/json" : "#set ($root=$input.path('$')) { \"stage\": \"$root.name\", \"user-id\": \"$root.key\" }", "application/xml" : "#set ($root=$input.path('$')) <stage>$root.name</stage> " }