-
Notifications
You must be signed in to change notification settings - Fork 113
Properties of HTTPResponses are now var #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, chatted about this before a bit
|
||
public init( | ||
statusCode: HTTPResponseStatus, | ||
headers: HTTPHeaders? = nil, | ||
multiValueHeaders: HTTPMultiValueHeaders? = nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed any longer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It never was supported in the first place. My mistake. Quote from docu:
To customize the response, your Lambda function should return a response with the following format.hv
{ "cookies" : ["cookie1", "cookie2"], "isBase64Encoded": true|false, "statusCode": httpStatusCode, "headers": { "headerName": "headerValue", ... }, "body": "Hello from Lambda!" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, need to point out in the release notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. one question re. change in API
Properties of HTTPResponse types should be
var
notlet
Motivation:
When creating responses in Lambda developers might want to create the response in multiple steps changing and adding properties. As of now this is not possible since all HTTPResponse types only have
let
properties. If a developer wants to mark a response as immutable they have still the option to mark the complete response aslet
.Modifications:
APIGateway.Response
,APIGateway.V2.Response
,ALB.TargetGroupResponse
) are nowvar
iableAPIGateway.V2.Response
. See example/documentation at the very endResult:
Developers have an easier job creating responses. 🥳