Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ProblemDetailsService #42384

Merged
merged 65 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
15126b5
MVC Changes
brunolins16 Jun 1, 2022
00e7615
ExceptionHandler changes
brunolins16 Jun 1, 2022
9adc269
Routing changes
brunolins16 Jun 1, 2022
c430ae2
Http.Extensions changes
brunolins16 Jun 1, 2022
a8939e5
Minimal APi draft changes
brunolins16 Jun 1, 2022
79690d8
HttpResults changes
brunolins16 Jun 1, 2022
c548e2b
New ProblemDetails project
brunolins16 Jun 1, 2022
7f368a8
Using ProblemDetailsOptions in mvc
brunolins16 Jun 2, 2022
acb590b
ProblemDetails project simplification
brunolins16 Jun 2, 2022
62eb53e
Using metadata
brunolins16 Jun 7, 2022
9618302
Using metadata
brunolins16 Jun 7, 2022
a747f04
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jun 7, 2022
8e25910
Latest version
brunolins16 Jun 10, 2022
22b0932
Removing changes
brunolins16 Jun 10, 2022
f6a5c37
Initial cleanup
brunolins16 Jun 10, 2022
b2fabfb
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jun 13, 2022
c13a1bd
Clean up
brunolins16 Jun 16, 2022
80aa845
Public api clean up
brunolins16 Jun 17, 2022
e0d4333
Updating public API
brunolins16 Jun 17, 2022
3fa6af0
More clean ups
brunolins16 Jun 17, 2022
89fd8ec
Adding initial unit tests
brunolins16 Jun 20, 2022
dca5c73
Updating unit tests
brunolins16 Jun 21, 2022
e885b3a
Adding more unit tests
brunolins16 Jun 23, 2022
a593c2b
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jun 23, 2022
9877120
Cleanup
brunolins16 Jun 23, 2022
2e0c98e
Clean up
brunolins16 Jun 23, 2022
e8f0e1a
clean up
brunolins16 Jun 23, 2022
6316af7
clean up
brunolins16 Jun 23, 2022
0ed099e
Removing nullable
brunolins16 Jun 23, 2022
a883706
Simplifying public api
brunolins16 Jun 25, 2022
1ecb0e0
API Review feedback
brunolins16 Jun 27, 2022
cfb8f88
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jun 27, 2022
6813d58
API review feedback
brunolins16 Jun 28, 2022
6b15f58
Clean up
brunolins16 Jun 28, 2022
a50ef62
Clean up
brunolins16 Jun 28, 2022
6565091
clean up
brunolins16 Jun 28, 2022
550dd9d
Reusing Endpoint & EndpointMetadataCollection
brunolins16 Jun 29, 2022
f9fd5f6
Fix build issues
brunolins16 Jun 29, 2022
804ccac
Updates based on docs/Trimming.md
brunolins16 Jun 29, 2022
54e369d
Adding Functional tests
brunolins16 Jun 30, 2022
1e695aa
Fix unittest
brunolins16 Jun 30, 2022
2a743db
Seal context
brunolins16 Jun 30, 2022
8bbe54c
Seal ProblemMetadata
brunolins16 Jun 30, 2022
a04b7ae
PR Feeback
brunolins16 Jul 6, 2022
cf188c2
API Review
brunolins16 Jul 8, 2022
5be8bd9
Clean up
brunolins16 Jul 8, 2022
86401b7
Fixing publicapi warnings
brunolins16 Jul 8, 2022
72b97a1
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jul 8, 2022
3f58002
Clean up
brunolins16 Jul 11, 2022
7dadaed
PR Feedback
brunolins16 Jul 11, 2022
5cb3286
Fixing build
brunolins16 Jul 11, 2022
e03c3e3
Fix unit test
brunolins16 Jul 11, 2022
988a20e
Fix unit tests
brunolins16 Jul 11, 2022
8c823a4
PR review
brunolins16 Jul 11, 2022
483f54e
Fixing JsonSerializationContext issues
brunolins16 Jul 11, 2022
35de3fe
Adding statuscode 405
brunolins16 Jul 12, 2022
1ba1f10
Update src/Http/Http.Extensions/src/ProblemDetailsDefaultWriter.cs
brunolins16 Jul 12, 2022
2455ccb
PR review
brunolins16 Jul 12, 2022
cd92e30
Apply suggestions from code review
brunolins16 Jul 12, 2022
d35ff2b
Merge branch 'main' into brunolins16/issues/32957
brunolins16 Jul 13, 2022
55cb7da
Fixing bad merge
brunolins16 Jul 13, 2022
8585070
Fix bad merge
brunolins16 Jul 13, 2022
2c12741
Adding analysis.NextMiddlewareName
brunolins16 Jul 13, 2022
4b84cf3
PR review
brunolins16 Jul 13, 2022
1fe3f3b
Changing to CanWrite/WriteAsync
brunolins16 Jul 13, 2022
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
41 changes: 41 additions & 0 deletions AspNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Html.A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RateLimiting", "RateLimiting", "{1D865E78-7A66-4CA9-92EE-2B350E45281F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Http.ProblemDetails", "Http.ProblemDetails", "{41AF137D-4181-42F9-9B53-BEDB9532F29B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Http.ProblemDetails", "src\Http\ProblemDetails\src\Microsoft.AspNetCore.Http.ProblemDetails.csproj", "{2333E682-F9E9-4235-BF63-6403C114EA76}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RequestDecompression.Microbenchmarks", "src\Middleware\RequestDecompression\perf\Microbenchmarks\Microsoft.AspNetCore.RequestDecompression.Microbenchmarks.csproj", "{3309FA1E-4E95-49E9-BE2A-827D01FD63C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-jwts", "src\Tools\dotnet-user-jwts\src\dotnet-user-jwts.csproj", "{B34CB502-0286-4939-B25F-45998528A802}"
Expand All @@ -1746,6 +1750,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestInfrastructure", "TestI
src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json = src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Http.ProblemDetails.Tests", "src\Http\ProblemDetails\test\Microsoft.AspNetCore.Http.ProblemDetails.Tests.csproj", "{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Templates.Mvc.Tests", "src\ProjectTemplates\test\Templates.Mvc.Tests\Templates.Mvc.Tests.csproj", "{AA7445F5-BD28-400C-8507-E2E0D3CF7D7E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Templates.Blazor.Server.Tests", "src\ProjectTemplates\test\Templates.Blazor.Server.Tests\Templates.Blazor.Server.Tests.csproj", "{281BF9DB-7B8A-446B-9611-10A60903F125}"
Expand Down Expand Up @@ -10391,6 +10397,22 @@ Global
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x64.Build.0 = Release|Any CPU
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x86.ActiveCfg = Release|Any CPU
{487EF7BE-5009-4C70-B79E-45519BDD9603}.Release|x86.Build.0 = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|arm64.ActiveCfg = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|arm64.Build.0 = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|x64.ActiveCfg = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|x64.Build.0 = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|x86.ActiveCfg = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Debug|x86.Build.0 = Debug|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|Any CPU.Build.0 = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|arm64.ActiveCfg = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|arm64.Build.0 = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|x64.ActiveCfg = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|x64.Build.0 = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|x86.ActiveCfg = Release|Any CPU
{2333E682-F9E9-4235-BF63-6403C114EA76}.Release|x86.Build.0 = Release|Any CPU
{3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3309FA1E-4E95-49E9-BE2A-827D01FD63C0}.Debug|arm64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -10455,6 +10477,22 @@ Global
{89896261-C5DD-4901-BCA7-7A5F718BC008}.Release|x64.Build.0 = Release|Any CPU
{89896261-C5DD-4901-BCA7-7A5F718BC008}.Release|x86.ActiveCfg = Release|Any CPU
{89896261-C5DD-4901-BCA7-7A5F718BC008}.Release|x86.Build.0 = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|arm64.ActiveCfg = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|arm64.Build.0 = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|x64.ActiveCfg = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|x64.Build.0 = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|x86.ActiveCfg = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Debug|x86.Build.0 = Debug|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|Any CPU.Build.0 = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|arm64.ActiveCfg = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|arm64.Build.0 = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|x64.ActiveCfg = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|x64.Build.0 = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|x86.ActiveCfg = Release|Any CPU
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11}.Release|x86.Build.0 = Release|Any CPU
{AA7445F5-BD28-400C-8507-E2E0D3CF7D7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA7445F5-BD28-400C-8507-E2E0D3CF7D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA7445F5-BD28-400C-8507-E2E0D3CF7D7E}.Debug|arm64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -11375,12 +11413,15 @@ Global
{51D07AA9-6297-4F66-A7BD-71CE7E3F4A3F} = {0F84F170-57D0-496B-8E2C-7984178EF69F}
{487EF7BE-5009-4C70-B79E-45519BDD9603} = {412D4C15-F48F-4DB1-940A-131D1AA87088}
{1D865E78-7A66-4CA9-92EE-2B350E45281F} = {E5963C9F-20A6-4385-B364-814D2581FADF}
{41AF137D-4181-42F9-9B53-BEDB9532F29B} = {627BE8B3-59E6-4F1D-8C9C-76B804D41724}
{2333E682-F9E9-4235-BF63-6403C114EA76} = {41AF137D-4181-42F9-9B53-BEDB9532F29B}
{3309FA1E-4E95-49E9-BE2A-827D01FD63C0} = {5465F96F-33D5-454E-9C40-494E58AEEE5D}
{B34CB502-0286-4939-B25F-45998528A802} = {AB4B9E75-719C-4589-B852-20FBFD727730}
{AB4B9E75-719C-4589-B852-20FBFD727730} = {0B200A66-B809-4ED3-A790-CB1C2E80975E}
{7F079E92-32D5-4257-B95B-CFFB0D49C160} = {7FD32066-C831-4E29-978C-9A2215E85C67}
{89896261-C5DD-4901-BCA7-7A5F718BC008} = {AB4B9E75-719C-4589-B852-20FBFD727730}
{F0FBA346-D8BC-4FAE-A4B2-85B33FA23055} = {08D53E58-4AAE-40C4-8497-63EC8664F304}
{13384A43-5CF9-4CBE-9F20-B4D6FB304C11} = {41AF137D-4181-42F9-9B53-BEDB9532F29B}
{AA7445F5-BD28-400C-8507-E2E0D3CF7D7E} = {08D53E58-4AAE-40C4-8497-63EC8664F304}
{281BF9DB-7B8A-446B-9611-10A60903F125} = {08D53E58-4AAE-40C4-8497-63EC8664F304}
{A5946454-4788-4871-8F23-A9471D55F115} = {4FDDC525-4E60-4CAF-83A3-261C5B43721F}
Expand Down
1 change: 1 addition & 0 deletions eng/ProjectReferences.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Http" ProjectPath="$(RepoRoot)src\Http\Http\src\Microsoft.AspNetCore.Http.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Metadata" ProjectPath="$(RepoRoot)src\Http\Metadata\src\Microsoft.AspNetCore.Metadata.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Owin" ProjectPath="$(RepoRoot)src\Http\Owin\src\Microsoft.AspNetCore.Owin.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Http.ProblemDetails" ProjectPath="$(RepoRoot)src\Http\ProblemDetails\src\Microsoft.AspNetCore.Http.ProblemDetails.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Routing.Abstractions" ProjectPath="$(RepoRoot)src\Http\Routing.Abstractions\src\Microsoft.AspNetCore.Routing.Abstractions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Routing" ProjectPath="$(RepoRoot)src\Http\Routing\src\Microsoft.AspNetCore.Routing.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.WebUtilities" ProjectPath="$(RepoRoot)src\Http\WebUtilities\src\Microsoft.AspNetCore.WebUtilities.csproj" />
Expand Down
1 change: 1 addition & 0 deletions eng/SharedFramework.Local.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Http.Features" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Http.Results" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Http" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Http.ProblemDetails" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Routing.Abstractions" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Routing" />
<AspNetCoreAppReference Include="Microsoft.AspNetCore.WebUtilities" />
Expand Down
1 change: 1 addition & 0 deletions eng/TrimmableProjects.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<TrimmableProject Include="Microsoft.AspNetCore.Http.Features" />
<TrimmableProject Include="Microsoft.AspNetCore.Http" />
<TrimmableProject Include="Microsoft.AspNetCore.Metadata" />
<TrimmableProject Include="Microsoft.AspNetCore.Http.ProblemDetails" />
<TrimmableProject Include="Microsoft.AspNetCore.Routing.Abstractions" />
<TrimmableProject Include="Microsoft.AspNetCore.Routing" />
<TrimmableProject Include="Microsoft.AspNetCore.WebUtilities" />
Expand Down
22 changes: 22 additions & 0 deletions src/Http/Http.Abstractions/src/Metadata/IProblemDetailsMetadata.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Http.Metadata;

/// <summary>
/// Defines a contract used to specify metadata,in <see cref="Endpoint.Metadata"/>,
/// for configure <see cref=" Mvc.ProblemDetails"/> generation.
/// </summary>
public interface IProblemDetailsMetadata
{
/// <summary>
/// Gets the HTTP status code of the response.
/// </summary>
public int? StatusCode { get; }
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Gets the Problem Details Types
/// associated to the <see cref="StatusCode"/>.
/// </summary>
public ProblemDetailsTypes ProblemType { get; }
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Microsoft.AspNetCore.Http.HttpResponse</Description>
<Compile Include="$(SharedSourceRoot)PropertyHelper\**\*.cs" />
<Compile Include="$(SharedSourceRoot)\UrlDecoder\UrlDecoder.cs" Link="UrlDecoder.cs" />
<Compile Include="$(SharedSourceRoot)ValueTaskExtensions\**\*.cs" />
<Compile Include="$(SharedSourceRoot)ProblemDetails\*JsonConverter.cs" LinkBase="ProblemDetails\Converters" />
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Http;

/// <summary>
/// Defines a type that provide functionality to
/// create a <see cref="Mvc.ProblemDetails"/> response.
/// </summary>
public interface IProblemDetailsService
{
/// <summary>
/// Write a <see cref="Mvc.ProblemDetails"/> response to the current context
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <param name="context">The <see cref="ProblemDetailsContext"/> associated with the current request/response.</param>
ValueTask WriteAsync(ProblemDetailsContext context);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Http;

/// <summary>
/// Defines a type that write a <see cref="Mvc.ProblemDetails"/>
/// payload to the current <see cref="HttpContext.Response"/>.
/// </summary>
public interface IProblemDetailsWriter
{
/// <summary>
/// Write a <see cref="Mvc.ProblemDetails"/> response to the current context
/// </summary>
/// <param name="context">The <see cref="ProblemDetailsContext"/> associated with the current request/response.</param>
/// <returns>Flag that indicates if the response was started.</returns>
ValueTask<bool> WriteAsync(ProblemDetailsContext context);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Mvc;

namespace Microsoft.AspNetCore.Http;

/// <summary>
/// Represent the current problem detatils context for the request.
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public class ProblemDetailsContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProblemDetailsContext"/>.
/// </summary>
/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request being processed by the filter.</param>
public ProblemDetailsContext(HttpContext httpContext)
{
HttpContext = httpContext;
}

/// <summary>
/// The <see cref="HttpContext"/> associated with the current request being processed by the filter.
/// </summary>
public HttpContext HttpContext { get; }

/// <summary>
/// A collection of additional arbitrary metadata associated with the current request endpoint.
/// </summary>
public EndpointMetadataCollection? AdditionalMetadata { get; init; }

/// <summary>
/// A instance of <see cref="ProblemDetails"/> that will be
brunolins16 marked this conversation as resolved.
Show resolved Hide resolved
/// used during the response payload generation.
/// </summary>
public ProblemDetails? ProblemDetails { get; init; }
}
36 changes: 36 additions & 0 deletions src/Http/Http.Abstractions/src/ProblemDetails/ProblemTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Http;

/// <summary>
/// Represents the possible problem details types.
/// </summary>
[Flags]
public enum ProblemDetailsTypes : uint
{
/// <summary>
/// Specifies no types.
/// </summary>
None = 0,

/// <summary>
/// HTTP Status code 5xx
/// </summary>
Server = 1,

/// <summary>
/// Failures occurred during the routing system processing.
/// </summary>
Routing = 2,

/// <summary>
/// HTTP Status code 4xx
/// </summary>
Client = 4,

/// <summary>
/// Specifies all types.
/// </summary>
All = Routing | Server | Client,
}
37 changes: 37 additions & 0 deletions src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,37 @@ Microsoft.AspNetCore.Http.DefaultRouteHandlerInvocationContext
Microsoft.AspNetCore.Http.DefaultRouteHandlerInvocationContext.DefaultRouteHandlerInvocationContext(Microsoft.AspNetCore.Http.HttpContext! httpContext, params object![]! arguments) -> void
Microsoft.AspNetCore.Http.EndpointMetadataCollection.Enumerator.Current.get -> object!
Microsoft.AspNetCore.Http.EndpointMetadataCollection.GetRequiredMetadata<T>() -> T!
Microsoft.AspNetCore.Http.HttpValidationProblemDetails
Microsoft.AspNetCore.Http.HttpValidationProblemDetails.Errors.get -> System.Collections.Generic.IDictionary<string!, string![]!>!
Microsoft.AspNetCore.Http.HttpValidationProblemDetails.HttpValidationProblemDetails() -> void
Microsoft.AspNetCore.Http.HttpValidationProblemDetails.HttpValidationProblemDetails(System.Collections.Generic.IDictionary<string!, string![]!>! errors) -> void
Microsoft.AspNetCore.Http.IBindableFromHttpContext<TSelf>
Microsoft.AspNetCore.Http.IBindableFromHttpContext<TSelf>.BindAsync(Microsoft.AspNetCore.Http.HttpContext! context, System.Reflection.ParameterInfo! parameter) -> System.Threading.Tasks.ValueTask<TSelf?>
Microsoft.AspNetCore.Http.IProblemDetailsService
Microsoft.AspNetCore.Http.IProblemDetailsService.WriteAsync(Microsoft.AspNetCore.Http.ProblemDetailsContext! context) -> System.Threading.Tasks.ValueTask
Microsoft.AspNetCore.Http.IProblemDetailsWriter
Microsoft.AspNetCore.Http.IProblemDetailsWriter.WriteAsync(Microsoft.AspNetCore.Http.ProblemDetailsContext! context) -> System.Threading.Tasks.ValueTask<bool>
Microsoft.AspNetCore.Http.IRouteHandlerFilter.InvokeAsync(Microsoft.AspNetCore.Http.RouteHandlerInvocationContext! context, Microsoft.AspNetCore.Http.RouteHandlerFilterDelegate! next) -> System.Threading.Tasks.ValueTask<object?>
Microsoft.AspNetCore.Http.Metadata.IFromFormMetadata
Microsoft.AspNetCore.Http.Metadata.IFromFormMetadata.Name.get -> string?
Microsoft.AspNetCore.Http.Metadata.IProblemDetailsMetadata
Microsoft.AspNetCore.Http.Metadata.IProblemDetailsMetadata.ProblemType.get -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.Metadata.IProblemDetailsMetadata.StatusCode.get -> int?
Microsoft.AspNetCore.Http.Metadata.IRequestSizeLimitMetadata
Microsoft.AspNetCore.Http.Metadata.IRequestSizeLimitMetadata.MaxRequestBodySize.get -> long?
Microsoft.AspNetCore.Http.ProblemDetailsContext
Microsoft.AspNetCore.Http.ProblemDetailsContext.AdditionalMetadata.get -> Microsoft.AspNetCore.Http.EndpointMetadataCollection?
Microsoft.AspNetCore.Http.ProblemDetailsContext.AdditionalMetadata.init -> void
Microsoft.AspNetCore.Http.ProblemDetailsContext.HttpContext.get -> Microsoft.AspNetCore.Http.HttpContext!
Microsoft.AspNetCore.Http.ProblemDetailsContext.ProblemDetails.get -> Microsoft.AspNetCore.Mvc.ProblemDetails?
Microsoft.AspNetCore.Http.ProblemDetailsContext.ProblemDetails.init -> void
Microsoft.AspNetCore.Http.ProblemDetailsContext.ProblemDetailsContext(Microsoft.AspNetCore.Http.HttpContext! httpContext) -> void
Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.ProblemDetailsTypes.All = Microsoft.AspNetCore.Http.ProblemDetailsTypes.Server | Microsoft.AspNetCore.Http.ProblemDetailsTypes.Routing | Microsoft.AspNetCore.Http.ProblemDetailsTypes.Client -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.ProblemDetailsTypes.Client = 4 -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.ProblemDetailsTypes.None = 0 -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.ProblemDetailsTypes.Routing = 2 -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.ProblemDetailsTypes.Server = 1 -> Microsoft.AspNetCore.Http.ProblemDetailsTypes
Microsoft.AspNetCore.Http.RouteHandlerContext
Microsoft.AspNetCore.Http.RouteHandlerContext.ApplicationServices.get -> System.IServiceProvider!
Microsoft.AspNetCore.Http.RouteHandlerContext.EndpointMetadata.get -> System.Collections.Generic.IList<object!>!
Expand All @@ -35,6 +59,19 @@ Microsoft.AspNetCore.Http.Metadata.IEndpointDescriptionMetadata
Microsoft.AspNetCore.Http.Metadata.IEndpointDescriptionMetadata.Description.get -> string!
Microsoft.AspNetCore.Http.Metadata.IEndpointSummaryMetadata
Microsoft.AspNetCore.Http.Metadata.IEndpointSummaryMetadata.Summary.get -> string!
Microsoft.AspNetCore.Mvc.ProblemDetails
Microsoft.AspNetCore.Mvc.ProblemDetails.Detail.get -> string?
Microsoft.AspNetCore.Mvc.ProblemDetails.Detail.set -> void
Microsoft.AspNetCore.Mvc.ProblemDetails.Extensions.get -> System.Collections.Generic.IDictionary<string!, object?>!
Microsoft.AspNetCore.Mvc.ProblemDetails.Instance.get -> string?
Microsoft.AspNetCore.Mvc.ProblemDetails.Instance.set -> void
Microsoft.AspNetCore.Mvc.ProblemDetails.ProblemDetails() -> void
Microsoft.AspNetCore.Mvc.ProblemDetails.Status.get -> int?
Microsoft.AspNetCore.Mvc.ProblemDetails.Status.set -> void
Microsoft.AspNetCore.Mvc.ProblemDetails.Title.get -> string?
Microsoft.AspNetCore.Mvc.ProblemDetails.Title.set -> void
Microsoft.AspNetCore.Mvc.ProblemDetails.Type.get -> string?
Microsoft.AspNetCore.Mvc.ProblemDetails.Type.set -> void
abstract Microsoft.AspNetCore.Http.RouteHandlerInvocationContext.Arguments.get -> System.Collections.Generic.IList<object?>!
abstract Microsoft.AspNetCore.Http.RouteHandlerInvocationContext.GetArgument<T>(int index) -> T
abstract Microsoft.AspNetCore.Http.RouteHandlerInvocationContext.HttpContext.get -> Microsoft.AspNetCore.Http.HttpContext!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<Compile Include="$(SharedSourceRoot)ParameterBindingMethodCache.cs" LinkBase="Shared"/>
<Compile Include="$(SharedSourceRoot)PropertyAsParameterInfo.cs" LinkBase="Shared"/>
<Compile Include="..\..\Shared\StreamCopyOperationInternal.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)ProblemDetailsJsonConverter.cs" LinkBase="Shared"/>
<Compile Include="$(SharedSourceRoot)HttpValidationProblemDetailsJsonConverter.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)RoutingMetadata\AcceptsMetadata.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)TypeNameHelper\TypeNameHelper.cs" LinkBase="Shared"/>
</ItemGroup>
Expand Down
Loading