You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,43 @@
1
1
# Migration Guide
2
2
3
+
## Upgrading from 0.28.x to 0.29.0
4
+
5
+
The builder methods on `ValidationOptions` now take ownership of `self`. Change your code to use method chaining instead of reusing the options instance:
6
+
7
+
```rust
8
+
// Old (0.28.x)
9
+
letmutoptions=jsonschema::options();
10
+
options.with_draft(Draft::Draft202012);
11
+
options.with_format("custom", |s|s.len() > 3);
12
+
letvalidator=options.build(&schema)?;
13
+
14
+
// New (0.29.0)
15
+
letvalidator=jsonschema::options()
16
+
.with_draft(Draft::Draft202012)
17
+
.with_format("custom", |s|s.len() > 3)
18
+
.build(&schema)?;
19
+
```
20
+
21
+
If you implement the `Retrieve` trait, update the `uri` parameter type in the `retrieve` method:
This is a type-level change only; the behavior and available methods remain the same.
40
+
3
41
## Upgrading from 0.25.x to 0.26.0
4
42
5
43
The `Validator::validate` method now returns `Result<(), ValidationError<'i>>` instead of an error iterator. If you need to iterate over all validation errors, use the new `Validator::iter_errors` method.
0 commit comments