RequestParameters for Api Event in Serverless::Function in JSON - how does it work?
I'm trying to add some query string parameters for a Lambda function, using a SAM template written in JSON. All the examples are in YAML? Can anyone point out where I'm going wrong.
Here's the snippet of the definition:
```
"AreaGet": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "SpeciesRecordLambda::SpeciesRecordLambda.Functions::AreaGet",
"Runtime": "dotnet6",
"CodeUri": "",
"MemorySize": 256,
"Timeout": 30,
"Role": null,
"Policies": [
"AWSLambdaBasicExecutionRole"
],
"Events": {
"AreaGet": {
"Type": "Api",
"Properties": {
"Path": "/",
"Method": "GET",
"RequestParameters": [
"method.request.querystring.latlonl": {
"Required": "true"
},
"method.request.querystring.latlonr": {
"Required": "true"
}
]
}
}
}
}
},
```
and here's the error message I get:
> Failed to create CloudFormation change set: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [AreaGet] is invalid. Event with id [AreaGet] is invalid. Invalid value for 'RequestParameters' property. Keys must be in the format 'method.request.[querystring|path|header].{value}', e.g 'method.request.header.Authorization'.
Sorry I know this is a bit of a beginners question, but I'm a bit lost as to what to do, as I can't find any information about this using JSON. Maybe you can't do it using JSON?
Thanks,
Andy.