Skip to content

Commit cff6551

Browse files
committed
Depend on System.Text.Json 6.0
1 parent afc562e commit cff6551

File tree

4 files changed

+32
-26
lines changed

4 files changed

+32
-26
lines changed

paket.dependencies

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source https://api.nuget.org/v3/index.json
55
nuget FSharp.Core >= 4.7.0 lowest_matching:true
66
nuget Microsoft.SourceLink.GitHub prerelease copy_local:true
77
nuget Nerdbank.GitVersioning copy_local:true
8-
nuget System.Text.Json >= 4.6.0 lowest_matching: true
8+
nuget System.Text.Json >= 6.0 lowest_matching: true
99

1010
group test
1111
framework net6.0
@@ -15,7 +15,7 @@ source https://api.nuget.org/v3/index.json
1515
nuget FSharp.Core >= 5.0
1616
nuget FsCheck.XUnit
1717
nuget Microsoft.NET.Test.Sdk ~> 16.3.0
18-
nuget System.Text.Json >= 6.0 prerelease
18+
nuget System.Text.Json >= 6.0
1919
nuget xunit ~> 2.4.0
2020
nuget xunit.runner.visualstudio ~> 2.4.0
2121
nuget BenchmarkDotNet
@@ -27,7 +27,7 @@ storage none
2727
source https://api.nuget.org/v3/index.json
2828

2929
nuget FSharp.Core >= 5.0
30-
nuget System.Text.Json >= 5.0
30+
nuget System.Text.Json >= 6.0
3131
nuget FsCheck.XUnit
3232
nuget xunit ~> 2.4.0
3333
nuget xunit.console ~> 2.4.0

paket.lock

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ RESTRICTION: == netstandard2.0
33
NUGET
44
remote: https://api.nuget.org/v3/index.json
55
FSharp.Core (4.7)
6-
Microsoft.Bcl.AsyncInterfaces (5.0)
6+
Microsoft.Bcl.AsyncInterfaces (6.0)
77
System.Threading.Tasks.Extensions (>= 4.5.4)
88
Microsoft.Build.Tasks.Git (1.1.0-beta-21055-01) - copy_local: true
99
Microsoft.SourceLink.Common (1.1.0-beta-21055-01) - copy_local: true
@@ -17,18 +17,19 @@ NUGET
1717
System.Numerics.Vectors (>= 4.4)
1818
System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
1919
System.Numerics.Vectors (4.5)
20-
System.Runtime.CompilerServices.Unsafe (5.0)
21-
System.Text.Encodings.Web (5.0.1)
20+
System.Runtime.CompilerServices.Unsafe (6.0)
21+
System.Text.Encodings.Web (6.0)
22+
System.Buffers (>= 4.5.1)
23+
System.Memory (>= 4.5.4)
24+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
25+
System.Text.Json (6.0)
26+
Microsoft.Bcl.AsyncInterfaces (>= 6.0)
2227
System.Buffers (>= 4.5.1)
2328
System.Memory (>= 4.5.4)
24-
System.Text.Json (4.6)
25-
Microsoft.Bcl.AsyncInterfaces (>= 1.0)
26-
System.Buffers (>= 4.5)
27-
System.Memory (>= 4.5.3)
2829
System.Numerics.Vectors (>= 4.5)
29-
System.Runtime.CompilerServices.Unsafe (>= 4.6)
30-
System.Text.Encodings.Web (>= 4.6)
31-
System.Threading.Tasks.Extensions (>= 4.5.2)
30+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
31+
System.Text.Encodings.Web (>= 6.0)
32+
System.Threading.Tasks.Extensions (>= 4.5.4)
3233
System.Threading.Tasks.Extensions (4.5.4)
3334
System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
3435

@@ -131,18 +132,18 @@ NUGET
131132
System.Reflection.Emit (4.7)
132133
System.Reflection.Emit.Lightweight (4.7)
133134
System.Reflection.Metadata (5.0)
134-
System.Runtime.CompilerServices.Unsafe (6.0.0-rc.2.21480.5)
135+
System.Runtime.CompilerServices.Unsafe (6.0)
135136
System.Security.AccessControl (5.0)
136137
Microsoft.NETCore.Platforms (>= 5.0)
137138
System.Security.Principal.Windows (>= 5.0)
138139
System.Security.Principal.Windows (5.0)
139140
System.Text.Encoding.CodePages (5.0)
140141
Microsoft.NETCore.Platforms (>= 5.0)
141-
System.Text.Encodings.Web (6.0.0-rc.2.21480.5)
142-
System.Runtime.CompilerServices.Unsafe (>= 6.0.0-rc.2.21480.5)
143-
System.Text.Json (6.0.0-rc.2.21480.5)
144-
System.Runtime.CompilerServices.Unsafe (>= 6.0.0-rc.2.21480.5)
145-
System.Text.Encodings.Web (>= 6.0.0-rc.2.21480.5)
142+
System.Text.Encodings.Web (6.0)
143+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
144+
System.Text.Json (6.0)
145+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
146+
System.Text.Encodings.Web (>= 6.0)
146147
System.Threading.Tasks.Extensions (4.5.4)
147148
System.ValueTuple (4.5)
148149
xunit (2.4.1)
@@ -211,6 +212,7 @@ NUGET
211212
System.Runtime (4.3.1)
212213
Microsoft.NETCore.Platforms (>= 1.1.1)
213214
Microsoft.NETCore.Targets (>= 1.1.3)
215+
System.Runtime.CompilerServices.Unsafe (6.0)
214216
System.Runtime.Loader (4.3)
215217
System.IO (>= 4.3)
216218
System.Reflection (>= 4.3)
@@ -219,7 +221,11 @@ NUGET
219221
Microsoft.NETCore.Platforms (>= 1.1)
220222
Microsoft.NETCore.Targets (>= 1.1)
221223
System.Runtime (>= 4.3)
222-
System.Text.Json (5.0.2)
224+
System.Text.Encodings.Web (6.0)
225+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
226+
System.Text.Json (6.0)
227+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
228+
System.Text.Encodings.Web (>= 6.0)
223229
System.Threading.Tasks (4.3)
224230
Microsoft.NETCore.Platforms (>= 1.1)
225231
Microsoft.NETCore.Targets (>= 1.1)

src/FSharp.SystemTextJson/Collection.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type JsonSetConverter<'T when 'T : comparison>(fsOptions) =
4848
let tIsNullable = isNullableFieldType fsOptions tType
4949
let needsNullChecking = not tIsNullable && not tType.IsValueType
5050

51-
let rec read (acc: Set<'T>) (reader: byref<Utf8JsonReader>) options =
51+
let rec read (acc: Set<'T>) (reader: byref<Utf8JsonReader>) (options: JsonSerializerOptions) =
5252
if not (reader.Read()) then acc else
5353
match reader.TokenType with
5454
| JsonTokenType.EndArray -> acc
@@ -93,7 +93,7 @@ type JsonStringMapConverter<'V>() =
9393

9494
let ty = typeof<Map<string, 'V>>
9595

96-
let rec read (acc: Map<string, 'V>) (reader: byref<Utf8JsonReader>) options =
96+
let rec read (acc: Map<string, 'V>) (reader: byref<Utf8JsonReader>) (options: JsonSerializerOptions) =
9797
if not (reader.Read()) then acc else
9898
match reader.TokenType with
9999
| JsonTokenType.EndObject -> acc
@@ -129,7 +129,7 @@ type JsonWrappedStringMapConverter<'K, 'V when 'K : comparison>() =
129129
let wrap = FSharpValue.PreComputeUnionConstructor(case, true)
130130
let unwrap = FSharpValue.PreComputeUnionReader(case, true)
131131

132-
let rec read (acc: Map<'K, 'V>) (reader: byref<Utf8JsonReader>) options =
132+
let rec read (acc: Map<'K, 'V>) (reader: byref<Utf8JsonReader>) (options: JsonSerializerOptions) =
133133
if not (reader.Read()) then acc else
134134
match reader.TokenType with
135135
| JsonTokenType.EndObject -> acc
@@ -161,7 +161,7 @@ type JsonMapConverter<'K, 'V when 'K : comparison>() =
161161

162162
let ty = typeof<Map<'K, 'V>>
163163

164-
let rec read (acc: Map<'K, 'V>) (reader: byref<Utf8JsonReader>) options =
164+
let rec read (acc: Map<'K, 'V>) (reader: byref<Utf8JsonReader>) (options: JsonSerializerOptions) =
165165
if not (reader.Read()) then acc else
166166
match reader.TokenType with
167167
| JsonTokenType.EndArray -> acc

src/FSharp.SystemTextJson/Union.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ type JsonUnionConverter<'T>
251251
| true, p -> ValueSome p
252252
| false, _ -> ValueNone
253253

254-
let readField (reader: byref<Utf8JsonReader>) (case: Case) (f: Field) options =
254+
let readField (reader: byref<Utf8JsonReader>) (case: Case) (f: Field) (options: JsonSerializerOptions) =
255255
reader.Read() |> ignore
256256
if f.MustBeNonNull && reader.TokenType = JsonTokenType.Null then
257257
let msg = sprintf "%s.%s(%s) was expected to be of type %s, but was null." ty.Name case.Name f.Name f.Type.Name
@@ -426,7 +426,7 @@ type JsonUnionConverter<'T>
426426
writer.WriteStartObject()
427427
writeFieldsAsRestOfObject writer case value options
428428

429-
let writeFields writer case value options =
429+
let writeFields (writer: Utf8JsonWriter) case value (options: JsonSerializerOptions) =
430430
if case.UnwrappedSingleField then
431431
JsonSerializer.Serialize(writer, (case.Dector value).[0], case.Fields.[0].Type, options)
432432
elif namedFields then

0 commit comments

Comments
 (0)