Skip to content

Commit 627ad7f

Browse files
authored
Merge pull request #97 from marcominerva/develop
Deprecate ProducesDefaultProblem and update docs/deps
2 parents 4a76e29 + 4ec13f4 commit 627ad7f

File tree

3 files changed

+2
-38
lines changed

3 files changed

+2
-38
lines changed

README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -120,43 +120,6 @@ app.Run();
120120
> **Note**
121121
The `MapEndpoints` method is generated by the Source Generator.
122122

123-
## MinimalHelpers.OpenApi
124-
125-
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.OpenApi)](https://www.nuget.org/packages/MinimalHelpers.OpenApi)
126-
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.OpenApi)](https://www.nuget.org/packages/MinimalHelpers.OpenApi)
127-
128-
A library that provides OpenAPI helpers for Minimal API projects.
129-
130-
### Installation
131-
132-
The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.OpenApi). Search for *MinimalHelpers.OpenApi* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
133-
134-
```shell
135-
dotnet add package MinimalHelpers.OpenApi
136-
```
137-
138-
### Usage
139-
140-
***Extension methods for RouteHandlerBuilder***
141-
142-
Often, endpoints have multiple 4xx return values, each producing a `ProblemDetails` response:
143-
144-
```csharp
145-
endpoints.MapGet("/api/people/{id:guid}", Get)
146-
.ProducesProblem(StatusCodes.Status400BadRequest)
147-
.ProducesProblem(StatusCodes.Status401Unauthorized)
148-
.ProducesProblem(StatusCodes.Status403Forbidden)
149-
.ProducesProblem(StatusCodes.Status404NotFound);
150-
```
151-
152-
To avoid multiple calls to `ProducesProblem`, use the `ProducesDefaultProblem` extension method provided by the library:
153-
154-
```csharp
155-
endpoints.MapGet("/api/people/{id:guid}", Get)
156-
.ProducesDefaultProblem(StatusCodes.Status400BadRequest, StatusCodes.Status401Unauthorized,
157-
StatusCodes.Status403Forbidden, StatusCodes.Status404NotFound);
158-
```
159-
160123
## MinimalHelpers.FluentValidation
161124

162125
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.FluentValidation)](https://www.nuget.org/packages/MinimalHelpers.FluentValidation)

samples/MinimalSample/MinimalSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
1111
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.2" />
1212
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.0" />
13-
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.12" />
13+
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.15" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/MinimalHelpers.OpenApi/RouteHandlerBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class RouteHandlerBuilderExtensions
1616
/// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
1717
/// <param name="statusCodes">The list of status codes to be added as <see cref="ProblemDetails"/> responses.</param>
1818
/// <returns>The <see cref="RouteHandlerBuilder"/> with the new status codes responses.</returns>
19+
[Obsolete("This method will be removed in future versions. Use the ProducesDefaultProblem method that is available in the TinyHelpers.AspNetCoore library instead.")]
1920
public static RouteHandlerBuilder ProducesDefaultProblem(this RouteHandlerBuilder builder, params int[] statusCodes)
2021
{
2122
foreach (var statusCode in statusCodes)

0 commit comments

Comments
 (0)