Validations with this library can be built by declaring Validation types, using the built-in
types supplied with the library, or conforming your types to the Validatable protocol.
Using Validator’s
Below is an example of using a validator that you define for a given type.
swift-validations
A swift package for creating validations, using
ResultBuilder
syntax.Additional Resources
Overview
Validations with this library can be built by declaring
Validation
types, using the built-in types supplied with the library, or conforming your types to theValidatable
protocol.Using Validator’s
Below is an example of using a validator that you define for a given type.
Conforming to
Validatable
You can conform types to the
Validatable
protocol orAsyncValidatable
, which are types that can validate an instance of itself.Generally you will supply the
Validation/body-swift.property-2e4vc
property. Which uses result builder syntax.However you can also implement the
Validation/validate(_:)-lqpu
.Documentation
Read the api documentation here.