Skip to content

Commit 4986552

Browse files
authored
Update validation.md
Add a bit of documentation on the new validation helpers.
1 parent 81995cf commit 4986552

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

documentation/validation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ let contentMapValidator = Validation(
326326
)
327327
```
328328

329-
Lastly, OpenAPIKit offers the `all()` function that will combine any number of `Validations` in the current context (as opposed to `lift()` and `unwrap()` which take you from one context to another).
329+
If you want to use a keypath to get from one context to another where there is potentially a JSON Reference between, it can be handy to use the `lookup()` function. The `lookup()` function takes a keypath that ends in an `Either<JSONReference<T>, T>` and lifts a validation context with a subject of `T` into any other validations you want to run. There is also an `unwrapAndLookup()` helper for keypaths that produce optional either references (`Either<JSONReference<T>, T>?`).
330+
331+
Lastly, OpenAPIKit offers the `all()` function that will combine any number of `Validations` in the current context (as opposed to `lift()`, `unwrap()`, and others which take you from one context to another).
330332
```swift
331333
let passwordValid1 = Validation<String>(...)
332334
let passwordValid2 = Validation<String>(...)

0 commit comments

Comments
 (0)