Skip to content

Add domainName property to API Gateway V1 event #24

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

Merged
merged 3 commits into from
Sep 13, 2022
Merged

Add domainName property to API Gateway V1 event #24

merged 3 commits into from
Sep 13, 2022

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