We have an endpoint that NSwag is generating schema like this for:
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {
"schema": {
"type": "file"
}
}
}
}
The method signature is
[HttpPost]
public async Task<IHttpActionResult> Callback(
string trackingId, [FromBody] CallbackRequest body)
According to speccy and the spec here, the "type": "file" is not valid. The type should be string.
Speccy gives error:
Specification schema is invalid.
expected 'file' to be equals one of Array [ 'integer', 'number', 'string', 'boolean', 'object', 'array' ]
Thanks for reporting, should be high prio and easy to fix
Will be in v12.0.16 soon
The "workaround" is to do what you should do anyway, and add some metadata to the action method, e.g.
[SwaggerResponse(HttpStatusCode.OK, typeof(void))]
[SwaggerResponse(HttpStatusCode.BadRequest, typeof(string))]
Most helpful comment
Thanks for reporting, should be high prio and easy to fix