Skip to content

Commit

Permalink
Fix: [AEA-4018] - fix incorrect 200 response (#277)
Browse files Browse the repository at this point in the history
## Summary
- Routine Change

### Details

Fixes incorrect 200 response when request made with trailing comma
  • Loading branch information
jonathanwelch1-nhs authored Jun 3, 2024
1 parent b2bd6e4 commit b880f75
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions SAMtemplates/apis/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,27 @@ Resources:
#set($payload = $util.parseJson($input.path('$.output')))
#set($context.responseOverride.status = $payload.Payload.statusCode)
#set($allHeaders = $payload.Payload.headers)
#foreach($headerName in $allHeaders.keySet())
#set($context.responseOverride.header[$headerName] = $allHeaders.get($headerName))
#end
$payload.Payload.body
- StatusCode: 400
SelectionPattern: ^4\d{2}.*
ResponseTemplates:
application/json: |-
#set($context.responseOverride.header["Content-Type"] ="application/fhir+json")
{"resourceType":"OperationOutcome","issue": [{"severity":"error","code":"processing","diagnostics":"System error"}]}
- StatusCode: 500
SelectionPattern: ^5\d{2}.*
ResponseTemplates:
application/json: |-
#set($context.responseOverride.header["Content-Type"] ="application/fhir+json")
{"resourceType":"OperationOutcome","issue": [{"severity":"error","code":"processing","diagnostics":"System error"}]}
MethodResponses:
- StatusCode: "200"
- StatusCode: "400"
- StatusCode: "500"

StatusLambdaMethodResource:
Type: AWS::ApiGateway::Resource
Expand Down

0 comments on commit b880f75

Please sign in to comment.