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