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: Support setting "content" property on request body #4

Open
tecfu opened this issue Jul 24, 2024 · 1 comment
Open

Comments

@tecfu
Copy link

tecfu commented Jul 24, 2024

Hello. I would like to be able to customize the content field in a requestBody in my Open API definition.
Let's say I want to update the body to use multipart/form-date, for example:

"requestBody": {
  "required": true,
  "content": {
    "multipart/form-data": {
      "schema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "FEATURE",
            "enum": [
              "FEATURE",
              "BUG"
            ]
          },
          "upload": {
            "type": "string",
            "format": "binary",
            "description": "The file being uploaded"
          }
        },
        "required": [
          "type",
          "upload"
        ]
      }
    }
  }
},

Please advise if a configuration exists for this. Thanks!

@bengotow
Copy link
Contributor

bengotow commented Jul 27, 2024

It does not currently, I was thinking that #3 would support it but it looks like we need to update the zod-to-openapi dep past 2.0 (https://github.com/asteasolutions/zod-to-openapi/releases/tag/v2.0.0) for that per their release notes, will see if it's straightforward 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants