Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added skip_serialization for JSON fields #632

Merged
merged 3 commits into from
Oct 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: added skip_serialization for JSON fields that should not be pres…
…ent if value is None
  • Loading branch information
xtovski authored Aug 11, 2023
commit b8339c05a9e06f9cdf8e170fa5cbbb56fd0c224e
2 changes: 2 additions & 0 deletions json/jsonrpc/src/convention.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ pub struct Response {
/// This member is REQUIRED on success.
/// This member MUST NOT exist if there was an error invoking the method.
/// The value of this member is determined by the method invoked on the Server.
#[serde(skip_serializing_if = "Option::is_none")]
robjtede marked this conversation as resolved.
Show resolved Hide resolved
pub result: Value,

// 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<ErrorData>,

/// This member is REQUIRED.
Expand Down