diff --git a/utoipa/src/openapi/example.rs b/utoipa/src/openapi/example.rs index 2374196f..b233aa56 100644 --- a/utoipa/src/openapi/example.rs +++ b/utoipa/src/openapi/example.rs @@ -32,12 +32,12 @@ builder! { #[serde(rename_all = "camelCase")] pub struct Example { /// Short description for the [`Example`]. - #[serde(skip_serializing_if = "String::is_empty")] + #[serde(skip_serializing_if = "String::is_empty", default)] pub summary: String, /// Long description for the [`Example`]. Value supports markdown syntax for rich text /// representation. - #[serde(skip_serializing_if = "String::is_empty")] + #[serde(skip_serializing_if = "String::is_empty", default)] pub description: String, /// Embedded literal example value. [`Example::value`] and [`Example::external_value`] are @@ -48,7 +48,7 @@ builder! { /// An URI that points to a literal example value. [`Example::external_value`] provides the /// capability to references an example that cannot be easily included in JSON or YAML. /// [`Example::value`] and [`Example::external_value`] are mutually exclusive. - #[serde(skip_serializing_if = "String::is_empty")] + #[serde(skip_serializing_if = "String::is_empty", default)] pub external_value: String, } }