omit empty error vec in data message serialization (#732)
This commit is contained in:
parent
db209b38c4
commit
6788ef20c8
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ pub struct DataPayload<S> {
|
||||||
|
|
||||||
/// The errors that have occurred during execution. Note that parse and validation errors are
|
/// The errors that have occurred during execution. Note that parse and validation errors are
|
||||||
/// not included here. They are sent via Error messages.
|
/// not included here. They are sent via Error messages.
|
||||||
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||||
pub errors: Vec<ExecutionError<S>>,
|
pub errors: Vec<ExecutionError<S>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +164,7 @@ mod test {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
r##"{"type":"data","id":"foo","payload":{"data":null,"errors":[]}}"##,
|
r##"{"type":"data","id":"foo","payload":{"data":null}}"##,
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
Loading…
Reference in a new issue