-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add primitive types to InsightsJsonSerializerContext that may be used…
… with ProblemDetails.Extensions
- Loading branch information
1 parent
9fa1f74
commit 468f3d4
Showing
1 changed file
with
31 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 31 additions & 1 deletion
32
src/Tingle.AspNetCore.ApplicationInsights/InsightsJsonSerializerContext.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 |
---|---|---|
@@ -1,7 +1,37 @@ | ||
using System.Text.Json.Serialization; | ||
using System.Text.Json.Nodes; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Tingle.AspNetCore.ApplicationInsights; | ||
|
||
[JsonSerializable(typeof(IDictionary<string, string[]>))] | ||
[JsonSerializable(typeof(IDictionary<string, object?>))] | ||
// These primitive types are declared for common types that may be used with ProblemDetails.Extensions. | ||
[JsonSerializable(typeof(bool))] | ||
[JsonSerializable(typeof(byte))] | ||
[JsonSerializable(typeof(sbyte))] | ||
[JsonSerializable(typeof(short))] | ||
[JsonSerializable(typeof(ushort))] | ||
[JsonSerializable(typeof(int))] | ||
[JsonSerializable(typeof(uint))] | ||
[JsonSerializable(typeof(long))] | ||
[JsonSerializable(typeof(ulong))] | ||
[JsonSerializable(typeof(float))] | ||
[JsonSerializable(typeof(double))] | ||
[JsonSerializable(typeof(decimal))] | ||
[JsonSerializable(typeof(char))] | ||
[JsonSerializable(typeof(string))] | ||
[JsonSerializable(typeof(DateTime))] | ||
[JsonSerializable(typeof(DateTimeOffset))] | ||
[JsonSerializable(typeof(TimeSpan))] | ||
[JsonSerializable(typeof(JsonArray))] | ||
[JsonSerializable(typeof(JsonObject))] | ||
[JsonSerializable(typeof(JsonDocument))] | ||
[JsonSerializable(typeof(DateOnly))] | ||
[JsonSerializable(typeof(TimeOnly))] | ||
#if NET8_0_OR_GREATER | ||
[JsonSerializable(typeof(Half))] | ||
[JsonSerializable(typeof(Int128))] | ||
[JsonSerializable(typeof(UInt128))] | ||
#endif | ||
internal partial class InsightsJsonSerializerContext : JsonSerializerContext { } |