From 841447c8e07024deacc2179787908856e2217dda Mon Sep 17 00:00:00 2001 From: Ruben Bartelink Date: Tue, 4 Nov 2025 11:53:01 +0000 Subject: [PATCH] Target STJ 10 --- CHANGELOG.md | 3 +++ src/FsCodec.SystemTextJson/FsCodec.SystemTextJson.fsproj | 2 +- src/FsCodec.SystemTextJson/Interop.fs | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) 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