Is this Swashbuckle? If so, questions regarding it should go to the project’s repo as it’s not a project we maintain.
That said, it looks like you’re trying to set a schema to a formData parameter, and that’s not supported by the spec. From: <[email protected]> on behalf of Tom Allen <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Wednesday, 5 July 2017 at 3:44 To: Swagger <[email protected]> Subject: Setting the schema ref in IOperationFilter I am trying to write my own filter and am having an issue with setting the schema.ref My Apply method currently looks something like this: public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) { if (operation.operationId == "Image_Test") { operation.consumes.Add("multipart/form-data"); operation.parameters = new List<Parameter> { new Parameter { name = "imageJson", required = true, description = "Image data (json)", @in = "formData", type = "string", schema = new Schema {@ref = "ImageData"} }, new Parameter { name = "fileStream", required = true, type = "file", description = "File stream", @in = "formData" } }; } } When I start my service, I see the ImageData model correctly defined under the DataType column, but I am also getting the following validation error: {"messages":["attribute paths.'/api/Image/AddWithFile'(post).[imageJson].schema is unexpected"],"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 2)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/parametersList/items"},"instance":{"pointer":"/paths/~1api~1Image~1AddWithFile/post/parameters/0"}}]} What am I doing wrong in my filter? -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
