Skip to content
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

Feature request: Add support for Files and Form in OpenAPI schema #3663

Open
2 tasks done
leandrodamascena opened this issue Jan 22, 2024 · 2 comments
Open
2 tasks done
Assignees
Labels
event_handlers feature-request feature request help wanted Could use a second pair of eyes/hands openapi-schema

Comments

@leandrodamascena
Copy link
Contributor

Use case

Original discussion: #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

@leandrodamascena leandrodamascena added triage Pending triage from maintainers feature-request feature request labels Jan 22, 2024
@leandrodamascena leandrodamascena added event_handlers and removed triage Pending triage from maintainers labels Jan 22, 2024
@leandrodamascena
Copy link
Contributor Author

Assigned to @rubenfonseca

@Hatter1337
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers feature-request feature request help wanted Could use a second pair of eyes/hands openapi-schema
Projects
Status: Backlog
Development

No branches or pull requests

3 participants