-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Boxed.AspNetCore - Upgrade to .NET Core 3 SDK and target `netcoreapp3.0`. - Switch from NuGet `PackageIconUrl` to `PackageIcon`, so the icon is now embedded in the package. - Upgrade `Micorosoft.Extensions.*` NuGet packages to `3.0.0`. - Switch from `Newtonsoft.Json` to `System.Text.Json`. - `DistributedCacheExtensions` now uses `System.Text.Json` and serializes directly to UTF8 for performance reasons. - Use Ordinal string comparisons. - Switch from `IHostingEnvironment` to `IWebHostEnvironment`. - `RedirectToCanonicalUrlRule` implements `Microsoft.AspNetCore.Rewrite.IRule` and can be used to redirect to a single canonical URL. This used to be an MVC filter. - `HttpExceptionMiddleware` now implements `IMiddleware`. - Remove site map code. Look at the source code for the The ASP.NET Core standup site for how to do this in a better way. - Remove `UrlHelperExtensions`. Use `LinkGenerator` instead. - Remove `ConfigurationExtensions.GetSection<T>`. Use `IConfiguration.Get` instead. - Remove `InternalServerErrorOnExceptionMiddleware` since it was unused. - Remove `NoCacheAttribute`. # Boxed.AspNetCore.Swagger - Upgrade to .NET Core 3 SDK and target `netcoreapp3.0`. - Upgrade to `Swashbuckle.AspNetCore` version `5.0.0-rc4` for Open API 3 support. - Switch from NuGet `PackageIconUrl` to `PackageIcon`, so the icon is now embedded in the package. - Added `CorrelationIdOperationFilter` operation filter. - Added `ProblemDetails` schema filter but this is not yet working so it's internal for now. See domaindrivendev/Swashbuckle.AspNetCore#985. - Removed `ModelStateDictionary`'s schema filter. # Boxed.AspNetCore.TagHelpers - Upgrade to .NET Core 3 SDK and target `netcoreapp3.0`. - Switch from NuGet `PackageIconUrl` to `PackageIcon`, so the icon is now embedded in the package. # Boxed.DotnetNewTest - Upgrade to .NET Core 3 SDK and target `netstandard2.1` and `netcoreapp3.0`. - Switch from NuGet `PackageIconUrl` to `PackageIcon`, so the icon is now embedded in the package. - Use Ordinal file path string comparisons. - Move experimental `DotnetRunInMemoryAsync` to be `netcoreapp3.0` only due to API limitations. # Boxed.Mapping - Upgrade to .NET Core 3 SDK and target `netstandard1.3`, `netstandard2.0` and `netstandard2.1`. - Switch from NuGet `PackageIconUrl` to `PackageIcon`, so the icon is now embedded in the package. - Add extension methods adding support for `IAsyncEnumerable<T>`.
- Loading branch information
1 parent
9673cb9
commit d4c3f9e
Showing
114 changed files
with
2,005 additions
and
2,940 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
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
120 changes: 60 additions & 60 deletions
120
Source/Boxed.AspNetCore.Swagger/Boxed.AspNetCore.Swagger.csproj
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 |
---|---|---|
@@ -1,60 +1,60 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup Label="Build"> | ||
<TargetFrameworks>netstandard2.0</TargetFrameworks> | ||
<LangVersion>latest</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<CodeAnalysisRuleSet>../../MinimumRecommendedRulesWithStyleCop.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Package"> | ||
<VersionPrefix>5.1.0</VersionPrefix> | ||
<Authors>Muhammad Rehan Saeed (RehanSaeed.com)</Authors> | ||
<Product>ASP.NET Core Swagger Framework Boxed</Product> | ||
<Description>Provides ASP.NET Core middleware, MVC filters, extension methods and helper code for an ASP.NET Core project implementing Swagger (OpenAPI).</Description> | ||
<Copyright>Copyright © Muhammad Rehan Saeed. All rights Reserved</Copyright> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageProjectUrl>https://github.com/Dotnet-Boxed/Framework</PackageProjectUrl> | ||
<PackageIcon>Icon-256x256.png</PackageIcon> | ||
<RepositoryUrl>https://github.com/Dotnet-Boxed/Framework.git</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageTags>ASP.NET;ASP.NET Core;MVC;Boxed;Muhammad Rehan Saeed;Framework;Swagger;OpenAPI;Swashbuckle</PackageTags> | ||
<PackageReleaseNotes>https://github.com/Dotnet-Boxed/Framework/releases</PackageReleaseNotes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Signing"> | ||
<SignAssembly>true</SignAssembly> | ||
<AssemblyOriginatorKeyFile>../../Key.snk</AssemblyOriginatorKeyFile> | ||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Source Link"> | ||
<!-- Optional: Declare that the Repository URL can be published to NuSpec --> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Optional: Include PDB in the built .nupkg --> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="Project References"> | ||
<ProjectReference Include="..\Boxed.AspNetCore\Boxed.AspNetCore.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Package References"> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.0.0-beta2-19367-01" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Analyzer Package References"> | ||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="all" Version="2.9.4" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="All" Version="16.3.52" /> | ||
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Files"> | ||
<None Include="..\..\Images\Icon-256x256.png" Pack="true" PackagePath="\"/> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup Label="Build"> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<CodeAnalysisRuleSet>../../MinimumRecommendedRulesWithStyleCop.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Package"> | ||
<VersionPrefix>6.0.0</VersionPrefix> | ||
<Authors>Muhammad Rehan Saeed (RehanSaeed.com)</Authors> | ||
<Product>ASP.NET Core Swagger Framework Boxed</Product> | ||
<Description>Provides ASP.NET Core middleware, MVC filters, extension methods and helper code for an ASP.NET Core project implementing Swagger (OpenAPI).</Description> | ||
<Copyright>Copyright © Muhammad Rehan Saeed. All rights Reserved</Copyright> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageProjectUrl>https://github.com/Dotnet-Boxed/Framework</PackageProjectUrl> | ||
<PackageIcon>Icon-256x256.png</PackageIcon> | ||
<RepositoryUrl>https://github.com/Dotnet-Boxed/Framework.git</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageTags>ASP.NET;ASP.NET Core;MVC;Boxed;Muhammad Rehan Saeed;Framework;Swagger;OpenAPI;Swashbuckle</PackageTags> | ||
<PackageReleaseNotes>https://github.com/Dotnet-Boxed/Framework/releases</PackageReleaseNotes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Signing"> | ||
<SignAssembly>true</SignAssembly> | ||
<AssemblyOriginatorKeyFile>../../Key.snk</AssemblyOriginatorKeyFile> | ||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Source Link"> | ||
<!-- Optional: Declare that the Repository URL can be published to NuSpec --> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Optional: Include PDB in the built .nupkg --> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="Project References"> | ||
<ProjectReference Include="..\Boxed.AspNetCore\Boxed.AspNetCore.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Package References"> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" Version="1.0.0-beta2-19554-01" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Analyzer Package References"> | ||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="all" Version="2.9.7" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all" Version="16.4.16" /> | ||
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" Version="1.1.118" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="Files"> | ||
<None Include="..\..\Images\Icon-256x256.png" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
55 changes: 55 additions & 0 deletions
55
Source/Boxed.AspNetCore.Swagger/OperationFilters/CorrelationIdOperationFilter.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,55 @@ | ||
namespace Boxed.AspNetCore.Swagger.OperationFilters | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.OpenApi.Any; | ||
using Microsoft.OpenApi.Models; | ||
using Swashbuckle.AspNetCore.SwaggerGen; | ||
|
||
/// <summary> | ||
/// Adds an Open API <see cref="OpenApiParameter"/> to all operations with a description of the X-Correlation-ID | ||
/// HTTP header and a default GUID value. | ||
/// </summary> | ||
/// <seealso cref="IOperationFilter" /> | ||
public class CorrelationIdOperationFilter : IOperationFilter | ||
{ | ||
/// <inheritdoc/> | ||
public void Apply(OpenApiOperation operation, OperationFilterContext context) | ||
{ | ||
if (operation is null) | ||
{ | ||
throw new ArgumentNullException(nameof(operation)); | ||
} | ||
|
||
if (context is null) | ||
{ | ||
throw new ArgumentNullException(nameof(context)); | ||
} | ||
|
||
if (operation.Parameters is null) | ||
{ | ||
operation.Parameters = new List<OpenApiParameter>(); | ||
} | ||
|
||
operation.Parameters.Add(this.GetCorrelationIdParameter()); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the Open API parameter for the X-Correlation-ID HTTP header. | ||
/// </summary> | ||
/// <returns>The Open API parameter for the X-Correlation-ID HTTP header.</returns> | ||
protected virtual OpenApiParameter GetCorrelationIdParameter() => | ||
new OpenApiParameter() | ||
{ | ||
Description = "Used to uniquely identify the HTTP request. This ID is used to correlate the HTTP request between a client and server.", | ||
In = ParameterLocation.Header, | ||
Name = "X-Correlation-ID", | ||
Required = false, | ||
Schema = new OpenApiSchema() | ||
{ | ||
Default = new OpenApiString(Guid.NewGuid().ToString()), | ||
Type = "string", | ||
}, | ||
}; | ||
} | ||
} |
Oops, something went wrong.