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

RapiDoc doesn't treat complex data as 'application/json' in 'multipart/form-data' request #1060

Open
glprojetinho2 opened this issue Nov 27, 2024 · 1 comment

Comments

@glprojetinho2
Copy link

Here is a quote from the OpenAPI docs:

If the property is complex, or an array of complex values, the default Content-Type is application/json.

That's not what I'm seeing in this example request:

"/test": {
  "post": {
    "summary": "Tests multipart",
    "operationId": "upload",
    "requestBody": {
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "string",
            "properties": {
              "shouldBeJson": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "description": "Success"
      }
    }
  }
}

image
Adding encoding doesn't work:

"encoding": {
  "metadata": {
    "contentType": "application/json"
  }
}

image

These requests were made with the help of a minimal actix server that I built to test this:
rapidoc.tar.gz
This gzip file also contains a Swagger-Ui version of the api docs. It has the same problem, but the "encoding trick" works (not completely)
Am I missing something? I'm having a lot of problems with this little thing.

@mrin9
Copy link
Collaborator

mrin9 commented Dec 5, 2024

thanks for reporting and pointing to the spec. I have added this to our task queue .
However at the moment we are in the middle of working for the next version which is bundling RapiDoc in pure ES Module format. This is adding up a lot of manual testing as our tests are not yet automated.
Expect some delay in newly reported issues

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