AWS Model schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "QuestionsModel",
"type": "array",
"items": {
"type": "object",
"properties": {
"placeholder" : { "type":"string" },
"type" : { "type":"string" },
"order": { "type": "integer" },
"prompt": { "type": "string" },
"section_name": { "type": "string" }
}
}
}
AWS Integration Response - Mapping Template - application/json
Mapping using Velocity Template Language An array...
#set($inputRoot = $input.path('$'))
[
#foreach($elem in $inputRoot)
{
"type" : "$elem.type",
"placeholder" : "$elem.placeholder",
"order" : "$elem.order",
"prompt" : "$elem.prompt",
"section_name" : "$elem.section_name"
}
#if($foreach.hasNext),#end
#end
]
AWS Lambda function
def lambda_handler(event, context):
client = boto3.client('dynamodb')
response = client.scan(
TableName='Question',
AttributesToGet=[
'type',
'order',
'section_name',
'prompt',
'placeholder'])
return = response['Items']
iOS app the Model
The iOS Model has a field type
of type NSString populated with the value {S=Hello World}
I'd rather the iOS field be equal to Hello World
saving me parsing {S=*}
Where am I going wrong?