1
Swashbuckle不会生成带有“UserCreateResponse”输出的swagger.json,你如何解决这个问题?Swashbuckle - 返回响应的swagger文档?
[HttpPost]
public async Task<IActionResult> Update([FromBody]UserCreate Request)
{
UserCreateResponse response = new UserCreateResponse();
//do something here
// returns UserCreateResponse with http status code 200
return Ok(response);
}
你不能做到这一点,因为它不打算返回的HTTP状态代码,200400401等
[HttpPost]
public async Task<UserCreateResponse> Update([FromBody]UserCreate Request)
{
UserCreateResponse response = new UserCreateResponse();
//do something here
// returns UserCreateResponse
return response;
}
谢谢hezye !!!! – 001