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

Content type multipart/form-data with property object or boolean results in a fatal error #738

Open
leumatt opened this issue Jul 6, 2023 · 0 comments
Labels

Comments

@leumatt
Copy link

leumatt commented Jul 6, 2023

Jane version(s) affected: 7.5.1

Description

A fatal error occurs when executing a POST operation with content type multipart/form-data that contains a type property different from string or integer => object, boolean,number,array

First argument to "Http\Message\MultipartStream\MultipartStreamBuilder::createStream()" must be a string, resource or StreamInterface.

How to reproduce
Generate a client for a POST operation with multipart/form-data and try to execute the operation.

OpenApi File

{
  "openapi": "3.0.1",
  "info": {
    "title": "API Test",
    "version": "1.0"
  },
  "paths": {
    "/File": {
      "post": {
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "fichier": {
                    "type": "string",
                    "format": "binary"
                  },
                  "item": {
                    "type": "object",
                    "properties": {
                      "itemId": {
                        "type": "integer"
                      },
                      "itemType": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

@leumatt leumatt added the bug label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant