revert `requireAllFields` regression (#3870)

#3864 introduced a regression by turning on `requireAllFields` globally
for JSON parsing. Certain endpoints such as `RestSyncInfo` have optional
fields that do not parse correctly without additional changes. This is
reverted for now to restore previous behaviour and unblock CI testing.
This commit is contained in:
Etan Kissling 2022-07-14 05:33:15 +02:00 committed by GitHub
parent ee4e4ddeab
commit 47a1b11d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2179,7 +2179,7 @@ proc decodeBody*[T](t: typedesc[T],
let data =
try:
RestJson.decode(body.data, T,
requireAllFields = true,
requireAllFields = false,
allowUnknownFields = true)
except SerializationError as exc:
debug "Failed to deserialize REST JSON data",
@ -2233,7 +2233,7 @@ proc decodeBytes*[T: DecodeTypes](t: typedesc[T], value: openArray[byte],
of "application/json":
try:
ok RestJson.decode(value, T,
requireAllFields = true,
requireAllFields = false,
allowUnknownFields = true)
except SerializationError as exc:
debug "Failed to deserialize REST JSON data",