Also ich versuche, eine grundlegende POST zu einer API-Post-Methode, die ich gemacht, die mit einem einfachen Dynamob verbunden ist. Ich habe folgende Body Mapping-Vorlage unter:Body Mapping Template + API-Gateway
{
"TableName": "bars",
"Item": {
"barid": {
"S": "$input.path('$.barid')"
},
"phone": {
"S": "$input.path('$.phone')"
},
"location": {
"S": "$input.path('$.location')"
},
"happyhour": {
"L": [
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
},
{
"M": {
"Time": {
"S": "$input.path('$.Time')"
},
"Deal": {
"S": "$input.path('$.Deal')"
},
"Day": {
"S": "$input.path('$.Day')"
}
}
}
]
},
"name": {
"S": "$input.path('$.name')"
}
}
}
Hier ist, was ich die Prüfung der Post-Anweisung mit:
{
"barid": {
"S": "005"
},
"happyhour": {
"L": [{
"M": {
"Time": {
"S": "11AM-9AM"
},
"Deal": {
"S": "$3 Mimosas; $3 Bloody Marys"
},
"Day": {
"S": "Sunday"
}
}
}, {
"M": {
"Time": {
"S": "4PM - 9PM"
},
"Deal": {
"S": "$4 Margaritas, Corona, Corona Light; $3 Bud Light Lime"
},
"Day": {
"S": "Monday"
}
}
}, {
"M": {
"Time": {
"S": "4PM-9PM"
},
"Deal": {
"S": "1/2 Price Burgers; $2 Bud and Bud Light Drafts"
},
"Day": {
"S": "Tuesday"
}
}
}, {
"M": {
"Time": {
"S": "4PM-9PM"
},
"Deal": {
"S": "$2 Drafts; $3 Food Menu"
},
"Day": {
"S": "Wednesday"
}
}
}, {
"M": {
"Time": {
"S": "4PM-9PM"
},
"Deal": {
"S": "$2 Beers, House Liquor, Flavored Vodka; 1/2 Price Wings; $5 Pizzas or Pasta Bowl"
},
"Day": {
"S": "Thursday"
}
}
}, {
"M": {
"Time": {
"S": "4PM-9PM"
},
"Deal": {
"S": "$5 Red Bull House Liquor Cocktails; $5 Wings, Nachos, Sliders, Flatbreads; $5 Finlandia Cocktails and Martinis; $15 Sam Adams Light Buckets"
},
"Day": {
"S": "Friday"
}
}
}, {
"M": {
"Time": {
"S": "None"
},
"Deal": {
"S": "None"
},
"Day": {
"S": "Sunday"
}
}
}]
},
"phone": {
"S": "(703) 527-1600"
},
"location": {
"S": "3100 Clarendon Blvd, Arlington, VA 22201"
},
"name": {
"S": "Mister Days"
}
}
Jedes Mal, wenn ich das laufen scheint es, dass es die auffüllt Barid-, Telefon- und Standortfeld, aber das happyhour-Feld bleibt leer. Unten ist, was ich in den Protokollen nach dem Test bekommen habe.
"TableName": "bars",
"Item": {
"barid": {
"S": "{S=005}"
},
"phone": {
"S": "{S=(703) 527-1576}"
},
"location": {
"S": "{S=2500 Hess Road}"
},
"happyhour": {
"L": [
{
"M": {
"Time": {
"S": ""
},
"Deal": {
"S": ""
},
"Day": {
"S": ""
}
}
},
{
"M": {
"Time": {
"S": ""
},
"Deal": {
"S": ""
},
"Day": {
"S": ""
}
}
},
{
"M": {
"Time": {
"S": ""
},
"Deal": {
"S": ""
},
"Day": {
"S": ""
}
[TRUNCATED]
Thu Jun 30 15:36:27 UTC 2016 : Endpoint response body before transformations: {"__type":"com.amazon.coral.service#UnknownOperationException"}
Nicht sicher, was ich falsch mache, aber irgendetwas würde helfen. Vielen Dank!
ich Ihre zweite Teil versucht laufen, die Sie vorgeschlagen, aber aus irgendeinem Grund es gab mir noch eine Serialisierung Fehler –
in den Protokollen es alles korrekt zugeordnet, aber aus irgendeinem Grund gibt es immer noch den Serialisierungsfehler –