From f0bdc9a7fb9cc7bc336b36850033f5db2fd0692b Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 21 Nov 2019 11:01:08 +0100 Subject: [PATCH] Add field with serde attribute to test to catch issues with serde attribute stripping in tests --- tests/ruma_api_macros.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ruma_api_macros.rs b/tests/ruma_api_macros.rs index fc033277..a99d24dd 100644 --- a/tests/ruma_api_macros.rs +++ b/tests/ruma_api_macros.rs @@ -36,6 +36,10 @@ pub mod some_endpoint { // With no attribute on the field, it will be extracted from the body of the response. pub value: String, + + // You can use serde attributes on any kind of field + #[serde(skip_serializing_if = "Option::is_none")] + pub optional_flag: Option, } } }