Feature request: Add support for cookie parameters in OpenAPI schema
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
- [X] This feature request meets Powertools for AWS Lambda (Python) Tenets
- [ ] Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
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.
Working on this.
Reassigned to @sthulb
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.
[!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