Never again without a contract: dry-validation
summary
Argues that writing a clear contract with dry-schema/dry-validation makes validation, coercion and rule logic explicit so payloads are rejected with a 400 or transformed into usable values; uses monads and pattern matching for flow control and composes schemas into contracts; demonstrates a monorepo containing a versioned gem of contracts and a Roda-mounted business API that runs and integrates; claims 149 test assertions running in ~0.5 ms and shows the contract approach catching structural and rule errors where plain schemas would not.
AI-written summary · about
chapters (40)
- 0:00Introduction
- 0:53Who am I
- 1:40Thank you
- 2:08Im old
- 2:31Agenda
- 3:11Exploitation
- 3:41No job anymore
- 3:55Never again without a contract
- 4:52Type checking
- 6:15Return carburetor
- 6:45Is it better
- 7:17Contracts
- 8:20Power for dryvalidation
- 8:41Why have you heard about dryvalidation
- 8:52Its not all about forms
- 9:41Schemas contacts
- 10:19Active mode is enough
- 11:17Sponsor
- 11:35Book recommendation
- 11:49Why is all about boundaries
- 12:10Schemas
- 12:23Use case
- 12:43Endpoints
- 13:05Name
- 14:08API
- 14:29Parameter
- 15:02Status
- 15:17Curve
- 16:03Success
- 18:41Parent
- 19:24Exercise
- 20:33Date
- 21:15Rules
- 22:23Contract
- 23:22Constraint
- 24:02Serializer
- 24:48Conclusions
- 25:14Test assertions
- 26:53Business API
- 28:20Little Buddy Lyrics
related talks
35mReal-world Functional Ruby
40mReinvesting in Ruby
27mA New Ruby Toolbox
39mFunctional Architecture for the Practical Rubyist
30mService Objects With Dry.rb: Monads and Transactions
44mReal-World Functional Ruby
32mThe little schema that could (...but should it?)
44mMaintaining Balance while Reducing Duplication: Part II
