Closed
Description
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 setting enable_swagger
Solution/User Experience
# usage
app.enable_swagger(..., compress=True)
and then in line
def enable_swagger(...):
...
return Response(
compress = compress
)
@self.get(path, middlewares=middlewares, include_in_schema=False, compress = compress)
def swagger_handler():
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
- 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
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped