Skip to content

Commit 7d3e38e

Browse files
Fix JSON serialization
1 parent b294c94 commit 7d3e38e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ProblemDetails
3232
/// (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be
3333
/// "about:blank".
3434
/// </summary>
35-
[JsonProperty( "type" )]
35+
[JsonProperty( "type", NullValueHandling = Ignore )]
3636
public string? Type { get; set; }
3737

3838
/// <summary>
@@ -72,5 +72,6 @@ public class ProblemDetails
7272
/// The round-tripping behavior for <see cref="Extensions"/> is determined by the implementation of the Input \ Output formatters.
7373
/// In particular, complex types or collection types may not round-trip to the original type when using the built-in JSON or XML formatters.
7474
/// </remarks>
75+
[JsonExtensionData]
7576
public IDictionary<string, object?> Extensions => extensions;
7677
}

0 commit comments

Comments
 (0)