From c15a176b1c6e91860e55c412bfa2aafb27c52d73 Mon Sep 17 00:00:00 2001 From: XT <73406141+xtovski@users.noreply.github.com> Date: Mon, 30 Oct 2023 00:28:44 +0100 Subject: [PATCH] fix: added skip_serialization for JSON fields (#632) Co-authored-by: Rob Ede --- json/jsonrpc/src/convention.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/json/jsonrpc/src/convention.rs b/json/jsonrpc/src/convention.rs index 26e8f2c2..2ef96b7d 100644 --- a/json/jsonrpc/src/convention.rs +++ b/json/jsonrpc/src/convention.rs @@ -109,6 +109,7 @@ pub struct Response { // This member is REQUIRED on error. // This member MUST NOT exist if there was no error triggered during invocation. // The value for this member MUST be an Object as defined in section 5.1. + #[serde(skip_serializing_if = "Option::is_none")] pub error: Option, /// This member is REQUIRED.