Skip to content

Commit

Permalink
Update Swashbuckle packages and improve parameter matching
Browse files Browse the repository at this point in the history
Updated `MinimalSample.csproj` to change `Swashbuckle.AspNetCore`
version from `6.8.0` to `6.8.1`. Similarly, updated
`MinimalHelpers.OpenApi.csproj` to change `Swashbuckle.AspNetCore.SwaggerGen`
version from `6.8.0` to `6.8.1`. Modified `GetByName` extension method
in `SwaggerExtensions.cs` to use case-insensitive comparison for
parameter names with `StringComparison.OrdinalIgnoreCase`.
  • Loading branch information
marcominerva committed Sep 30, 2024
1 parent 02f9542 commit 5d445b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/MinimalSample/MinimalSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.10.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/MinimalHelpers.OpenApi/MinimalHelpers.OpenApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.8.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/MinimalHelpers.OpenApi/SwaggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void AddFormFile(this SwaggerGenOptions options)
/// <returns>The <see cref="OpenApiParameter"/> object with the specified name.</returns>
/// <exception cref="InvalidOperationException">The parameter with the specified name was not found.</exception>
public static OpenApiParameter GetByName(this IList<OpenApiParameter> parameters, string name)
=> parameters.Single(p => p.Name == name);
=> parameters.Single(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase));

/// <summary>
/// Gets by name the <see cref="OpenApiParameter"/> that is available in the <see cref="OpenApiOperation"/> parameters list.
Expand Down

0 comments on commit 5d445b4

Please sign in to comment.