Open leandrodamascena opened 10 months ago
Assigned to @rubenfonseca
Hi 👋🏼
From the original discussion, I see this concerns app.enable_swagger()
.
Could you please let me know if it is possible to add multipart/form-data
to the request body when using app.get_openapi_json_schema
, or is this option currently unavailable as well?
@router.post(
"/user/activities/<activity_id>/assets",
summary="Create asset",
description="Create an asset for a user activity",
responses={
201: {
"description": "Created",
"content": {"application/json": {"model": models.ActivityAssetResponse}},
}
}
| default_openapi_responses, # 400, 409, etc.
tags=["User"],
)
Thank you.
Use case
Original discussion: https://github.com/aws-powertools/powertools-lambda-python/discussions/3609
OpenAPI supports File and Form fields in the Request Body and we must add support for this.
https://swagger.io/docs/specification/describing-request-body/
Solution/User Experience
Add support for File and Form fields.
Alternative solutions
No response
Acknowledgment