如何获得NSwag来识别POST路由上的“ application / json”返回类型?

时间:2019-10-24 16:32:55

标签: asp.net-core asp.net-core-webapi nswag

    [HttpPost]
    [ProducesResponseType(StatusCodes.Status201Created)]
    [Produces("application/json")]
    public async Task<IActionResult> Post(string filename = null, bool transmit = true)

NSwag无法识别Produces("application/json")属性。这可能吗?

1 个答案:

答案 0 :(得分:0)

尝试

[ProducesResponseType(typeof(void),StatusCodes.Status201Created)]