Skip to content

Conversation

MPLew-is
Copy link
Contributor

Add support for the existing domainName property to API Gateway V1 events in Swift.

Motivation:

According to AWS example events and documentation, this seems to be included in all requests.
We should be able to access this seamlessly in Swift.

Modifications:

  • Added domainName property to requestContext in APIGatewayRequest object
  • Added example values for domainName to corresponding tests

Result:

After this change, users can access the domain name with:

struct ApiGatewayHandler: LambdaHandler {
	typealias Event  = APIGatewayRequest
	typealias Output = APIGatewayResponse

	func handle(_ event: Event, context: LambdaContext) async throws -> Output {
		...
		let domainName: String = event.domainName
		...
	}
}

@swift-server-bot
Copy link

Can one of the admins verify this patch?

5 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@tomerd
Copy link
Contributor

tomerd commented Sep 13, 2022

@swift-server-bot test this please

And add a test to make sure both cases successfully decode.
@tomerd
Copy link
Contributor

tomerd commented Sep 13, 2022

@swift-server-bot test this please

@tomerd tomerd enabled auto-merge (squash) September 13, 2022 18:29
@MPLew-is MPLew-is requested a review from tomerd September 13, 2022 20:18
@tomerd tomerd merged commit b415da2 into swift-server:main Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants