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"
}
};
}
}{"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?
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.
--
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 swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.