Skip to content

Commit

Permalink
Don't serialize type: ~ for oneOf
Browse files Browse the repository at this point in the history
A simple bugfix found in the wild.
  • Loading branch information
emk committed Jun 9, 2022
1 parent 30d4c1b commit 1d9afa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openapi/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ pub struct OneOf {
/// `Some(Type::Object)`, because `oneOf` with a `discriminator` only works
/// for object types. OpenAPI 3.1 allows us to omit `type: object`, but
/// Readme.com requires it.
#[serde(rename = "type", default)]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,

/// Our child schemas.
Expand Down

0 comments on commit 1d9afa1

Please sign in to comment.