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

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

Open
zakipuzo opened this issue Jul 27, 2021 · 0 comments

Comments

@zakipuzo
Copy link

zakipuzo commented Jul 27, 2021

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
        ]
      });
      ```
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

1 participant