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

Add default to Example string fields #1218

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions utoipa/src/openapi/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
}
}
Expand Down
Loading