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
ResultBuildersyntax.Additional Resources
Overview
Validations with this library can be built by declaring
Validationtypes, using the built-in types supplied with the library, or conforming your types to theValidatableprotocol.Using Validator’s
Below is an example of using a validator that you define for a given type.
Conforming to
ValidatableYou can conform types to the
Validatableprotocol orAsyncValidatable, which are types that can validate an instance of itself.Generally you will supply the
Validation/body-swift.property-2e4vcproperty. Which uses result builder syntax.However you can also implement the
Validation/validate(_:)-lqpu.Documentation
Read the api documentation here.