Revert "Some fixes to nullability (#365)" (#366)

This reverts commit 8d275f0047.
This commit is contained in:
Patrick Stevens
2025-04-20 18:02:40 +01:00
committed by GitHub
parent 8d275f0047
commit 7930039ad1
14 changed files with 65 additions and 1697 deletions

View File

@@ -48,16 +48,7 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
jsonNode.AsArray ()
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|> Seq.map (fun elt -> Gym.jsonParse elt)
|> List.ofSeq
return jsonNode.AsArray () |> Seq.map (fun elt -> Gym.jsonParse elt) |> List.ofSeq
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -91,11 +82,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return GymAttendance.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -130,11 +116,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return GymAttendance.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -165,11 +146,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return Member.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -203,11 +179,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return Gym.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -238,11 +209,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return MemberActivityDto.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -273,11 +239,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return UriThing.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -333,11 +294,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
match jsonNode with
| null -> None
@@ -390,11 +346,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return Sessions.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -436,11 +387,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return Sessions.jsonParse jsonNode
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
@@ -932,11 +878,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
new RestEase.Response<_> (
responseString,
@@ -973,11 +914,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
new RestEase.Response<_> (
responseString,
@@ -1014,11 +950,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
new RestEase.Response<_> (
responseString,
@@ -1055,11 +986,6 @@ module PureGymApi =
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|> Async.AwaitTask
let jsonNode =
match jsonNode with
| null -> raise (System.ArgumentNullException ())
| v -> v
return
new RestEase.Response<_> (
responseString,