RubyConf 2022: Never again without a contract: dry-validation by Espartaco Palma
The same as you shouldn't work without a contract, our systems should accept external inputs without one, a written, clear and enforceable one. Define the structure & expected payload being aware of their schema, structure & types. Using dry-schema or dry-validation this part is a matter of a few lines of codes covering most of the cases you may find with the cherry-on-top: error handling out-of-the-box and if this not enough with optional pattern matching for results.
November 29, 2022