-
Notifications
You must be signed in to change notification settings - Fork 421
Feature request: Add compression for swagger ui #3935
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @xquek! Thanks for opening this issue with this important feature request. I completely agree with you that we should provide a way to allow customers to choose whether they want the HTTP Response to be compressed or not when serving the swagger file. This can be a challenge for anyone using a browser request that doesn't add the "Accept-Encoding" header, for example, but it's something we add in our documentation so the customer is aware. I like the implementation of adding a parameter Do you want to send a PR to add this feature? We can work together to get it merged before our next release. Thanks |
Hi @leandrodamascena! thanks for the feedback! ill be very happy to send in a PR! Thanks!! |
Hi there , i created - #3946 let me know if there is any question! thanks! |
|
Use case
Hi when serving swagger over ALB, there is a 1 MB limit.
We are able to get pass it by using swagger_base_url and servce the js file from it.
But i was wondering if ti will be possible to add a
compress
flag and return a compress response when settingenable_swagger
Solution/User Experience
and then in line
powertools-lambda-python/aws_lambda_powertools/event_handler/api_gateway.py
Line 1720 in fa235c0
or at
https://github.com/aws-powertools/powertools-lambda-python/blob/fa235c0d7335265342f3f13d189d7e10af0ed0b6/aws_lambda_powertools/event_handler/api_gateway.py#L1662C8-L1662C74
I have tested this on my local development stack, it went from over 1mb which results in 502, to ~ 330kb in response size.
We can set the default as false so it is backwards compatible
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: