diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f54a1..16746e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ The `Unreleased` section name is replaced by the expected version of next releas ### Added ### Changed + +- `SystemTextJson`: Upped minimum `System.Text.Json` version to `10.0.` [#129](https://github.com/jet/FsCodec/pull/129) + ### Removed ### Fixed diff --git a/src/FsCodec.SystemTextJson/FsCodec.SystemTextJson.fsproj b/src/FsCodec.SystemTextJson/FsCodec.SystemTextJson.fsproj index 1314d2f..2b74d01 100644 --- a/src/FsCodec.SystemTextJson/FsCodec.SystemTextJson.fsproj +++ b/src/FsCodec.SystemTextJson/FsCodec.SystemTextJson.fsproj @@ -27,7 +27,7 @@ - + diff --git a/src/FsCodec.SystemTextJson/Interop.fs b/src/FsCodec.SystemTextJson/Interop.fs index 5230d1c..d3a4700 100644 --- a/src/FsCodec.SystemTextJson/Interop.fs +++ b/src/FsCodec.SystemTextJson/Interop.fs @@ -4,12 +4,12 @@ open System open System.Runtime.CompilerServices open System.Text.Json -[] +[] type InteropHelpers private () = static member Utf8ToJsonElement(x: ReadOnlyMemory): JsonElement = if x.IsEmpty then JsonElement() - else JsonSerializer.Deserialize(x.Span) + else JsonElement.Parse x.Span static member JsonElementToUtf8(x: JsonElement): ReadOnlyMemory = if x.ValueKind = JsonValueKind.Undefined then ReadOnlyMemory.Empty