powertools-lambda-python icon indicating copy to clipboard operation
powertools-lambda-python copied to clipboard

Feature request: Add support for cookie parameters in OpenAPI schema

Open leandrodamascena opened this issue 1 year ago • 5 comments

Use case

Original discussion: https://github.com/aws-powertools/powertools-lambda-python/discussions/3609

OpenAPI supports Cookies parameters and we must add support for this!

https://swagger.io/docs/specification/describing-parameters/

Cookie Parameters

Operations can also pass parameters in the Cookie header, as Cookie: name=value. Multiple cookie parameters are sent in the same header, separated by a semicolon and space.

Solution/User Experience

Add Cookie in https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/event_handler/openapi/params.py

Alternative solutions

No response

Acknowledgment

leandrodamascena avatar Feb 01 '24 16:02 leandrodamascena

We're still keeping this on our backlog and will get to it eventually. If anyone has knowledge on the topic and would like to contribute, please leave a comment to claim the issue.

dreamorosi avatar Jan 24 '25 11:01 dreamorosi

Working on this.

leandrodamascena avatar Jul 16 '25 22:07 leandrodamascena

Reassigned to @sthulb

leandrodamascena avatar Jul 28 '25 17:07 leandrodamascena

Hi @sthulb, the main challenge here is that you need to identify each payload you have when working with proxies, such as multi-value headers and single-value headers, ALB, APIGateway REST/HTTP, VPC LATTICE v1 and v2, and Lambda function URLs.

For example, when working with ALB, you have this payload for single-value headers:

'headers': {'accept': '*/*', 'cookie': 'power=tools'...

But when working with multi-header values, you have this:

'multiValueHeaders': {'accept': ['*/*'], 'cookie': ['power=tools']..

What I suggest is creating a Lambda and connecting each proxy and variants that work with Lambda and dumping the event, so you can observe how cookies are sent differently in each situation.

leandrodamascena avatar Jul 29 '25 14:07 leandrodamascena

[!note] For those interested in contributing, please leave a comment below so that we can assign the issue to you and make sure we don't duplicate efforts. If you have any further questions, please don't hesitate to ask below or on our Discord server.

assign to me

oyiz-michael avatar Nov 14 '25 23:11 oyiz-michael