Skip to content

Commit

Permalink
fix nested Option types
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Apr 29, 2024
1 parent 372d0c2 commit d63ee9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub fn type_to_string(ty: &ReferenceOr<Schema>) -> String {
_ => "serde_json::Value".to_owned(),
};
// If property is nullable, we treat it as an optional argument.
if item.schema_data.nullable {
if item.schema_data.nullable && !base.contains("Option<") {
base = format!("Option<{}>", base);
}
base
Expand Down

0 comments on commit d63ee9e

Please sign in to comment.