-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Custom styles - Added IApplicationBuilder support (fixes #21) - New style type to avoid loading additional JS for modern styles - Fixes and enhancements - Added NSwag support
- Loading branch information
Showing
69 changed files
with
2,572 additions
and
370 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
51 changes: 51 additions & 0 deletions
51
samples/Sample.AspNetCore.SwaggerUI.NSwag/Controllers/SampleController.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,51 @@ | ||
#pragma warning disable S1133 // Deprecated code should be removed - Done for testing purposes | ||
#pragma warning disable CS0618 // Type or member is obsolete - Done for testing purposes | ||
|
||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Controllers; | ||
|
||
[ApiController] | ||
[Route("sample")] | ||
public class SampleController : ControllerBase | ||
{ | ||
[HttpHead("head")] | ||
[ProducesResponseType(typeof(int), StatusCodes.Status200OK)] | ||
[ProducesResponseType(StatusCodes.Status400BadRequest)] | ||
public IActionResult HeadSample([Required] int sample) | ||
{ | ||
return Ok(sample); | ||
} | ||
|
||
[HttpPatch("patch")] | ||
[ProducesResponseType(typeof(Models.Sample), StatusCodes.Status200OK)] | ||
[Produces("application/json")] | ||
public IActionResult PatchSample(Models.Sample model) | ||
{ | ||
return Ok(model); | ||
} | ||
|
||
[HttpOptions("options")] | ||
[Authorize] | ||
public IActionResult OptionsSample() | ||
{ | ||
return Ok(); | ||
} | ||
|
||
[HttpPost("form")] | ||
[Authorize] | ||
public IActionResult PostSample([FromForm] Models.Sample model, IFormFile form) | ||
{ | ||
return Ok(); | ||
} | ||
|
||
[HttpGet("get")] | ||
[ProducesResponseType(typeof(int), StatusCodes.Status200OK)] | ||
[Obsolete("test")] | ||
public IActionResult GetDisabledSample([Required] int sample) | ||
{ | ||
return Ok(sample); | ||
} | ||
} |
Oops, something went wrong.