Closed
Description
Expected Behaviour
Allow filling out fields and executing (try out) simple requests in swagger ui without validation errors.
Please note:
The openapi json (extracted from the swagger html) works well in other swaggers editors. I tested with several editors.
Current Behaviour
Multiple bugs in the swagger ui:
-
Two input fields representing two distinct query params seem to somehow be connected. They initialize to the same value (with no reason) and when the changes in the first field are also shown in the second.
-
Even when both required fields are filled, the ui reports of a validation error as if one of the field is missing
Code snippet
app = APIGatewayRestResolver(
enable_validation=True,
)
app.enable_swagger(
path="/docs/swagger",
title="My Company API",
)
@app.get("/v1/audience-anywhere")
def audience_anywhere(
network: Annotated[
Literal["twitter", "reddit"],
Query(description="The network name. Currently only 'twitter' supported"),
],
hashed_user_id: Annotated[str, Query(alias="hashed-user-id")],
) -> AudienceAnywhereResponse:
logger.debug({"network": network, "hashed-user-id": hashed_user_id})
return AudienceAnywhereResponse(audiences=["some value"])
Possible Solution
No response
Steps to Reproduce
create a simple lambda with the above code, deploy and test in browser
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.12
Packaging format used
Lambda Layers
Debugging logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped
Activity
boring-cyborg commentedon Dec 15, 2023
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
rubenfonseca commentedon Dec 18, 2023
Looking at this now
rubenfonseca commentedon Dec 18, 2023
We were using an outdated version of the Swagger UI that had problems, submitting a new PR to fix this!
github-actions commentedon Dec 18, 2023
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
github-actions commentedon Dec 18, 2023
This is now released under 2.30.2 version!