Hello,
I need more information regarding how to use the ‘template’ & ‘pattern’ keys when defining a REST API. The example that I see in the docs is below. However, I can’t find any documentation about how to define the values for these keys. I assume it is there somewhere, but so far I’ve come up short.
Thanks.
functions:
create:
handler: posts.create
events:
- http:
method: post
path: whatever
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
statusCodes:
201:
pattern: '' # Default response method
409:
pattern: '.*"statusCode":409,.*' # JSON response
template: $input.path("$.errorMessage") # JSON return object
headers:
Content-Type: "'application/json+hal'"