mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-08 20:54:33 +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 =
|
let data =
|
||||||
try:
|
try:
|
||||||
RestJson.decode(body.data, T,
|
RestJson.decode(body.data, T,
|
||||||
requireAllFields = true,
|
requireAllFields = false,
|
||||||
allowUnknownFields = true)
|
allowUnknownFields = true)
|
||||||
except SerializationError as exc:
|
except SerializationError as exc:
|
||||||
debug "Failed to deserialize REST JSON data",
|
debug "Failed to deserialize REST JSON data",
|
||||||
@ -2233,7 +2233,7 @@ proc decodeBytes*[T: DecodeTypes](t: typedesc[T], value: openArray[byte],
|
|||||||
of "application/json":
|
of "application/json":
|
||||||
try:
|
try:
|
||||||
ok RestJson.decode(value, T,
|
ok RestJson.decode(value, T,
|
||||||
requireAllFields = true,
|
requireAllFields = false,
|
||||||
allowUnknownFields = true)
|
allowUnknownFields = true)
|
||||||
except SerializationError as exc:
|
except SerializationError as exc:
|
||||||
debug "Failed to deserialize REST JSON data",
|
debug "Failed to deserialize REST JSON data",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user