Skip to content

Commit 8f7a898

Browse files
committed
Derive Default for Compoenents, Contact, Example and Flows
1 parent 95891fd commit 8f7a898

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

crates/oas3/src/spec/components.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::{
1313
/// they are explicitly referenced from properties outside the components object.
1414
///
1515
/// See <https://spec.openapis.org/oas/v3.1.0#components-object>.
16-
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
16+
#[derive(Debug, Clone, Default, PartialEq, Deserialize, Serialize)]
1717
pub struct Components {
1818
/// An object to hold reusable [Schema Objects](ObjectSchema).
1919
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]

crates/oas3/src/spec/contact.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct InvalidEmail;
1515
/// Contact information for the exposed API.
1616
///
1717
/// See <https://spec.openapis.org/oas/v3.1.0#contact-object>.
18-
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
18+
#[derive(Debug, Clone, Default, PartialEq, Deserialize, Serialize)]
1919
pub struct Contact {
2020
/// Identifying name of the contact person/organization.
2121
#[serde(skip_serializing_if = "Option::is_none")]

crates/oas3/src/spec/example.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use super::{spec_extensions, FromRef, Ref, RefError, RefType, Spec};
99
/// Will be validated against schema when used in conformance testing.
1010
///
1111
/// See <https://spec.openapis.org/oas/v3.1.0#example-object>.
12-
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
12+
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
1313
pub struct Example {
1414
/// Short description for the example.
1515
#[serde(skip_serializing_if = "Option::is_none")]

crates/oas3/src/spec/flows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::spec_extensions;
88
/// Allows configuration of the supported OAuth Flows.
99
///
1010
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flows-object>.
11-
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
11+
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
1212
#[serde(rename_all = "camelCase")]
1313
pub struct Flows {
1414
/// Configuration for the OAuth Implicit flow.

0 commit comments

Comments
 (0)