-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default of DefaultResponseReferenceTypeNullHandling to NotNull (…
…#2215) * Change default of DefaultResponseReferenceTypeNullHandling to NotNull * Add support for nullable response xml docs attribute
- Loading branch information
Showing
45 changed files
with
374 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...NSwag.Generation.AspNetCore.Tests.Web/Controllers/Responses/NullableResponseController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace NSwag.Generation.AspNetCore.Tests.Web.Controllers.Responses | ||
{ | ||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class NullableResponseController : Controller | ||
{ | ||
/// <summary> | ||
/// Gets an order. | ||
/// </summary> | ||
/// <response code="200" nullable="true">Order created.</response> | ||
/// <response code="404">Order not found.</response> | ||
[HttpPost("OperationWithNullableResponse")] | ||
[Produces("application/json")] | ||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)] | ||
[ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] | ||
public ActionResult<string> OperationWithNullableResponse() | ||
{ | ||
return Ok(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets an order. | ||
/// </summary> | ||
/// <response code="200" nullable="false">Order created.</response> | ||
/// <response code="404">Order not found.</response> | ||
[HttpPost("OperationWithNonNullableResponse")] | ||
[Produces("application/json")] | ||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)] | ||
[ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] | ||
public ActionResult<string> OperationWithNonNullableResponse() | ||
{ | ||
return Ok(); | ||
} | ||
|
||
[HttpPost("OperationWithNoXmlDocs")] | ||
[Produces("application/json")] | ||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)] | ||
[ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] | ||
public ActionResult<string> OperationWithNoXmlDocs() | ||
{ | ||
return Ok(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.