mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-02 09:46:26 +00:00
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:
parent
ee4e4ddeab
commit
47a1b11d5d
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user