Forum Discussion

RjI98's avatar
RjI98
Regular Visitor
5 years ago

Errors while trying to replace in:formData and type: 'File' with requestBody - OpenAPI 3.0

I was getting a few errors suggesting that I replace in: formData with the allowed values: path, query, cookie etc on Swagger Editor while migrating from Swagger 2.0 to OpenAPI 3.0.3. Here's what I had:

 

post: {
            tags: ["Client / Files"],
            description: "Returns a binscan report as an array with all the details for the scanned files and their matches.",
            parameters: [
                {
                    name: "file",
                    in: "formData",
                    description: "File with output from qscan or coreinfo",
                    required: true,
                    schema: {
                        type: "file"
                    }
                },
                {
                    name: "type",
                    in: "formData",
                    description: "The type of data that is in the uploaded file (defaults to \"qscan\" if blank)",
                    required: false,
                    schema: {
                        type: "string",
                        enum: ["qscan", "coreinfo"]
                    }
                },
                {
                    name: "architecture",
                    in: "formData",
                    description: "The architecture of the target that QScan was run on or the corefile was produced on. (defaults to \"all\" if blank)",
                    required: false,
                    schema: {
                        type: "string",
                        enum: ["all", "x86", "x86_64", "aarch64le", "armle-v7"]
                    }
                },
             ]

I tried replacing the parameters with requestBody but it seems like I cannot have multiple requestBody to replace the parameters as I am getting errors for that too. Any help is much appreciated. Thank you 🙂

No RepliesBe the first to reply