timriley on add-0-19-0-changelog
Add changelog entry for 0.19.0 (compare)
timriley on add-0-19-0-changelog
Add changelog entry for 0.19.0 (compare)
timriley on add-0-19-0-changelog
Add changelog entry for 0.19.0 (compare)
timriley on update-docsite-for-component-dirs
timriley on master
Reference dry-system without co… Use component_dirs config in do… Merge pull request #160 from dr… (compare)
timriley on update-docsite-for-component-dirs
Reference dry-system without co… Use component_dirs config in do… (compare)
timriley on master
Avoid freezing components Thes… Add dirs to load path so earlie… Extract Identifier; support mix… and 2 more (compare)
UserSchema.call({}).output
:)
you can use reform with dry-validation, it's pretty amazing
Great, OK then!
def initialize(params, options)
@options = options #this is the dependency hash
end
Schema#output
do?
validation = schema.call(params)
validation.success? ? validation.output : validation.messages
form.sync
User.new(schema.call(some_data_from_api))
<= just this
UserSchema = Dry::Validation.JSON do
required(:created_at).value(:date_time?)
end
class User < Dry::Struct
attribute :created_at, Types::Strict::DateTime
end
user_attrs = UserSchema.(user_data)
User.new(user_attrs)