Skip to content

multipart/form-data multiples propreties required in swagger display "unvalid" #186

Description

@zakipuzo

This is the working request body:

"requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "video",
                  "encodings"
                ],
                "properties": {
                  "video": {
                    "type": "string",
                    "format": "binary",
                    "description": "Upload video file"
                  },
                  "encodings": {
                    "type": "string",
                    "format": "binary",
                    "description": "Upload video file "
                  
                  }
                }
              } 
            }
          }
        }

This is the error message:

{"messages":["attribute paths.'/smile_video'(post).requestBody.content.'multipart/form-data'.schema.required is not of type `array`"],"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 2)","schema":{"loadingURI":"#","pointer":"/definitions/Operation/properties/requestBody"},"instance":{"pointer":"/paths/~1smile_video/post/requestBody"}}]}

I resolve this by disabling validation: validatorUrl : false

const ui = SwaggerUIBundle({
        url: url,
        dom_id: '#swagger-ui',
        deepLinking: true,
        validatorUrl : false,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ]
      });
      ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions