Skip to content

Commit

Permalink
Merge pull request #36 from kudlatyamroth/bugfix/keep-nullable-proper…
Browse files Browse the repository at this point in the history
…ty-after-resolving-one-of

fix: after resolving oneOf with null, keep it as nullable attribute
  • Loading branch information
kstasik authored Jul 23, 2021
2 parents 4452da2 + 668cb15 commit a61cbd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen/jsonschema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ fn add_validation_and_nullable(
let nullable = schema
.get("nullable")
.map(|v| v.as_bool().unwrap_or(false))
.unwrap_or(false);
.unwrap_or_else(|| model.attributes.nullable);

let validation = if !result.is_empty() {
Some(result)
Expand Down

0 comments on commit a61cbd4

Please sign in to comment.