Skip to content

Commit 0a99931

Browse files
Case 'code' attribute for JSON
1 parent 93495ad commit 0a99931

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/AspNet/WebApi/src/Asp.Versioning.WebApi/ProblemDetailsFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
namespace Asp.Versioning;
55

66
using Newtonsoft.Json;
7-
using System.Web.Http;
87
using static Asp.Versioning.ProblemDetailsDefaults;
98
using static Newtonsoft.Json.NullValueHandling;
109
using static System.Globalization.CultureInfo;

src/AspNetCore/WebApi/src/Asp.Versioning.Http/DefaultProblemDetailsFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@ public ProblemDetails CreateProblemDetails(
5151
/// <exception cref="ArgumentNullException"><paramref name="problemDetails"/> is <c>null</c>.</exception>
5252
public static void ApplyExtensions( ProblemDetails problemDetails )
5353
{
54-
const string Code = nameof( Code );
54+
const string code = nameof( code );
5555
var type = ( problemDetails ?? throw new ArgumentNullException( nameof( problemDetails ) ) ).Type;
5656

5757
if ( type == Ambiguous.Type )
5858
{
59-
problemDetails.Extensions[Code] = Ambiguous.Code;
59+
problemDetails.Extensions[code] = Ambiguous.Code;
6060
}
6161
else if ( type == Invalid.Type )
6262
{
63-
problemDetails.Extensions[Code] = Invalid.Code;
63+
problemDetails.Extensions[code] = Invalid.Code;
6464
}
6565
else if ( type == Unspecified.Type )
6666
{
67-
problemDetails.Extensions[Code] = Unspecified.Code;
67+
problemDetails.Extensions[code] = Unspecified.Code;
6868
}
6969
else if ( type == Unsupported.Type )
7070
{
71-
problemDetails.Extensions[Code] = Unsupported.Code;
71+
problemDetails.Extensions[code] = Unsupported.Code;
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)