Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions MinimalHelpers.slnx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<Solution>
<Folder Name="/OpenApi/">
<Project Path="src/MinimalHelpers.OpenApi/MinimalHelpers.OpenApi.csproj" />
</Folder>
<Folder Name="/Routing/">
<Project Path="src/MinimalHelpers.Routing.Analyzers/MinimalHelpers.Routing.Analyzers.csproj" />
<Project Path="src/MinimalHelpers.Routing/MinimalHelpers.Routing.csproj" />
</Folder>
<Folder Name="/Samples/">
<Folder Name="/samples/">
<Project Path="samples/MinimalSample/MinimalSample.csproj" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".github/copilot-instructions.md" />
<File Path="src/Directory.Build.props" />
</Folder>
<Folder Name="/Validation/">
<Folder Name="/src/" />
<Folder Name="/src/OpenApi/">
<Project Path="src/MinimalHelpers.OpenApi/MinimalHelpers.OpenApi.csproj" />
</Folder>
<Folder Name="/src/Routing/">
<Project Path="src/MinimalHelpers.Routing.Analyzers/MinimalHelpers.Routing.Analyzers.csproj" />
<Project Path="src/MinimalHelpers.Routing/MinimalHelpers.Routing.csproj" />
</Folder>
<Folder Name="/src/Validation/">
<Project Path="src/MinimalHelpers.FluentValidation/MinimalHelpers.FluentValidation.csproj" />
<Project Path="src/MinimalHelpers.Validation.Abstractions/MinimalHelpers.Validation.Abstractions.csproj" />
<Project Path="src/MinimalHelpers.Validation/MinimalHelpers.Validation.csproj" />
Expand Down
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ A collection of helper libraries for Minimal API projects.
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.Routing)](https://www.nuget.org/packages/MinimalHelpers.Routing)
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.Routing)](https://www.nuget.org/packages/MinimalHelpers.Routing)

A library that provides Routing helpers for Minimal API projects for automatic endpoints registration using Reflection.

A library that provides routing helpers for Minimal API projects, enabling automatic endpoint registration using reflection.
### Installation

The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Routing). Just search for *MinimalHelpers.Routing* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Routing). Search for *MinimalHelpers.Routing* in the **Package Manager GUI** or run the following command in the **.NET CLI**:

```shell
dotnet add package MinimalHelpers.Routing
```

### Usage

Create a class to hold your route handlers registration and have it implement the `IEndpointRouteHandlerBuilder` interface:
Create a class to hold your route handler registrations and have it implement the `IEndpointRouteHandlerBuilder` interface:

```csharp
public class PeopleEndpoints : MinimalHelpers.Routing.IEndpointRouteHandlerBuilder
Expand All @@ -40,7 +39,7 @@ public class PeopleEndpoints : MinimalHelpers.Routing.IEndpointRouteHandlerBuild
}
```

Call the `MapEndpoints()` extension method on the **WebApplication** object inside *Program.cs* before invoking the `Run()` method:
Call the `MapEndpoints()` extension method on the **WebApplication** object in *Program.cs* before invoking the `Run()` method:

```csharp
// using MinimalHelpers.Routing;
Expand Down Expand Up @@ -80,15 +79,15 @@ A library that provides a Source Generator for automatic endpoints registration

### Installation

The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Routing.Analyzers). Just search for *MinimalHelpers.Routing* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Routing.Analyzers). Search for *MinimalHelpers.Routing* in the **Package Manager GUI** or run the following command in the **.NET CLI**:

```shell
dotnet add package MinimalHelpers.Routing.Analyzers
```

### Usage

Create a class to hold your route handlers registration and have it implement the `IEndpointRouteHandlerBuilder` interface:
Create a class to hold your route handler registrations and have it implement the `IEndpointRouteHandlerBuilder` interface:

```csharp
public class PeopleEndpoints : IEndpointRouteHandlerBuilder
Expand All @@ -109,7 +108,7 @@ public class PeopleEndpoints : IEndpointRouteHandlerBuilder
> **Note**
You only need to use the **MinimalHelpers.Routing.Analyzers** package. With this Source Generator, the `IEndpointRouteHandlerBuilder` interface is auto-generated.

Call the `MapEndpoints()` extension method on the **WebApplication** object inside *Program.cs* before the `Run()` method invocation:
Call the `MapEndpoints()` extension method on the **WebApplication** object in *Program.cs* before the `Run()` method invocation:

```csharp
app.MapEndpoints();
Expand All @@ -129,7 +128,7 @@ A library that provides OpenAPI helpers for Minimal API projects.

### Installation

The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.OpenApi). Just search for *MinimalHelpers.OpenApi* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
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**:

```shell
dotnet add package MinimalHelpers.OpenApi
Expand All @@ -139,7 +138,7 @@ dotnet add package MinimalHelpers.OpenApi

***Extension methods for OpenApi***

This library provides several extension methods that simplify the OpenAPI configuration in Minimal API projects. For example, it is possible to customize the description of a response using its status code:
This library provides several extension methods that simplify the OpenAPI configuration in Minimal API projects. For example, you can customize the description of a response using its status code:

```csharp
endpoints.MapPost("login", LoginAsync)
Expand Down Expand Up @@ -174,7 +173,7 @@ endpoints.MapPost("login", LoginAsync)
.ProducesProblem(StatusCodes.Status404NotFound);
```

To avoid multiple calls to `ProducesProblem`, use the `ProducesDefaultProblem` extension method provided by the library::
To avoid multiple calls to `ProducesProblem`, use the `ProducesDefaultProblem` extension method provided by the library:

```csharp
endpoints.MapGet("/api/people/{id:guid}", Get)
Expand All @@ -187,11 +186,11 @@ endpoints.MapGet("/api/people/{id:guid}", Get)
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.Validation)](https://www.nuget.org/packages/MinimalHelpers.Validation)
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.Validation)](https://www.nuget.org/packages/MinimalHelpers.Validation)

A library that provides an Endpoint filter for Minimal API projects to perform validation with Data Annotations, using the <a href="https://github.com/DamianEdwards/MiniValidation">MiniValidation</a> library.
A library that provides an endpoint filter for Minimal API projects to perform validation using Data Annotations and the <a href="https://github.com/DamianEdwards/MiniValidation">MiniValidation</a> library.

### Installation

The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Validation). Just search for *MinimalHelpers.Validation* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.Validation). Search for *MinimalHelpers.Validation* in the **Package Manager GUI** or run the following command in the **.NET CLI**:

```shell
dotnet add package MinimalHelpers.Validation
Expand Down Expand Up @@ -274,11 +273,11 @@ You can use the `ValidationErrorTitleMessageFactory`, for example, if you want t
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.FluentValidation)](https://www.nuget.org/packages/MinimalHelpers.FluentValidation)
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.FluentValidation)](https://www.nuget.org/packages/MinimalHelpers.FluentValidation)

A library that provides an Endpoint filter for Minimal API projects to perform validation using <a href="https://fluentvalidation.net">FluentValidation</a>.
A library that provides an endpoint filter for Minimal API projects to perform validation using <a href="https://fluentvalidation.net">FluentValidation</a>.

### Installation

The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.FluentValidation). Just search for *MinimalHelpers.FluentValidation* in the **Package Manager GUI** or run the following command in the **.NET CLI**:
The library is available on [NuGet](https://www.nuget.org/packages/MinimalHelpers.FluentValidation). Search for *MinimalHelpers.FluentValidation* in the **Package Manager GUI** or run the following command in the **.NET CLI**:

```shell
dotnet add package MinimalHelpers.FluentValidation
Expand Down Expand Up @@ -367,4 +366,4 @@ You can use the `ValidationErrorTitleMessageFactory`, for example, if you want t

**Contributing**

The project is constantly evolving. Contributions are welcome! Please file issues or pull requests in the repository and they will be addressed as soon as possible.
The project is constantly evolving. Contributions are welcome. Feel free to file issues and pull requests in the repository, and we'll address them as we can.
4 changes: 2 additions & 2 deletions samples/MinimalSample/MinimalSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<ItemGroup>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.4" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.6" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/MinimalHelpers.OpenApi/MinimalHelpers.OpenApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.19" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.20" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down