-
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.
chore(deps): update swashbuckle-aspnetcore monorepo to 6.9.0 (#33)
* chore(deps): update swashbuckle-aspnetcore monorepo to 6.9.0 * feat: rename TypedResult controller and add proper content type test * Should be fixed * That should not be there * One day it will work * Again * Guess we don't want that... * Reword comment --------- Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: guillaume.caya <guillaume.caya@gsoft.com>
- Loading branch information
1 parent
3118f82
commit 093546e
Showing
9 changed files
with
268 additions
and
75 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
15 changes: 0 additions & 15 deletions
15
src/tests/WebApi.OpenAPI.SystemTest/ExtractTypeResult/TypedResultNoProducesController.cs
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
...sts/WebApi.OpenAPI.SystemTest/ExtractTypeResult/TypedResultProperContentTypeController.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,65 @@ | ||
using Microsoft.AspNetCore.Http.HttpResults; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace WebApi.OpenAPI.SystemTest.ExtractTypeResult; | ||
|
||
public class TypedResultProperContentTypeController | ||
{ | ||
[HttpGet] | ||
[EndpointName("OkNoContentType")] | ||
[Route("/useApplicationJsonContentTypeWithOk")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK)] | ||
public Ok GivenOkTypedResultAndNoContenTypeThenContentTypeApplicationJson() | ||
{ | ||
return TypedResults.Ok(); | ||
} | ||
|
||
[HttpGet] | ||
[EndpointName("TemplatedOkNoContentType")] | ||
[Route("/useApplicationJsonContentTypeWithOk<T>")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK)] | ||
public Ok<string> GivenTemplatedOkTypedResultAndNoContenTypeThenContentTypeApplicationJson() | ||
{ | ||
return TypedResults.Ok("example"); | ||
} | ||
|
||
[HttpGet] | ||
[EndpointName("ResultsNoContentType")] | ||
[Route("/useApplicationJsonContentTypeWithResultsType")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK)] | ||
[ProducesResponseType<string>(StatusCodes.Status400BadRequest, "text/plain")] | ||
[ProducesResponseType<string>(StatusCodes.Status404NotFound, "text/plain")] | ||
public Results<Ok<string>, BadRequest<string>, NotFound<string>> GivenResultsTypeAndNoContentTypeThenContentTypeApplicationJson() | ||
{ | ||
return TypedResults.Ok("example"); | ||
} | ||
|
||
[HttpGet] | ||
[EndpointName("OkContentTypeTextPlain")] | ||
[Route("/overwriteContenTypeWithProduceAttributeTextPlainForOk")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK, "text/plain")] | ||
public Ok GivenOkTypedResultAndContentTypeThenKeepContentType() | ||
{ | ||
return TypedResults.Ok(); | ||
} | ||
|
||
[HttpGet] | ||
[EndpointName("TemplatedOkContentTypeTextPlain")] | ||
[Route("/overwriteContenTypeWithProduceAttributeTextPlainForOk<T>")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK, "text/plain")] | ||
public Ok<string> GivenTemplatedOkTypedResultAndContentTypeThenKeepContentType() | ||
{ | ||
return TypedResults.Ok("example"); | ||
} | ||
|
||
[HttpGet] | ||
[EndpointName("ResultsContentTypeTextPlain")] | ||
[Route("/overwriteContenTypeWithProduceAttributeTextPlainForResultsType")] | ||
[ProducesResponseType<string>(StatusCodes.Status200OK, "text/plain")] | ||
[ProducesResponseType<string>(StatusCodes.Status400BadRequest, "text/plain")] | ||
[ProducesResponseType<string>(StatusCodes.Status404NotFound, "text/plain")] | ||
public Results<Ok<string>, BadRequest<string>, NotFound<string>> GivenResultsTypeAndContentTypeThenKeepContentType() | ||
{ | ||
return TypedResults.Ok("example"); | ||
} | ||
} |
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.