Skip to content

Commit

Permalink
fix: False negatives in some cases when calling JSONSchema.apply on…
Browse files Browse the repository at this point in the history
… schemas with `if` and `then` (without `else`) keywords

Ref: #318
  • Loading branch information
Stranger6667 committed Dec 8, 2021
1 parent 8740c4c commit 1139d29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- False positives in some cases when calling `JSONSchema.apply` on a schema with `additionalProperties`, `patternProperties`, and `properties` combined.
- False negatives in some cases when calling `JSONSchema.apply` on schemas with `if` and `then` (without `else`) keywords. [#318](https://github.com/Stranger6667/jsonschema-rs/pull/318)

### Performance

Expand Down
4 changes: 3 additions & 1 deletion jsonschema/src/keywords/if_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ impl Validate for IfThenValidator {
if if_result.is_valid() {
let then_result = self.then_schema.apply_rooted(instance, instance_path);
if_result += then_result;
if_result.into()
} else {
PartialApplication::valid_empty()
}
if_result.into()
}
}

Expand Down

0 comments on commit 1139d29

Please sign in to comment.