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)
timriley on support-component-dirs-with-mixed-namespaces
to_time = -> x { Time.iso8601("#{x}Z") }
ISOTime = Types::Strict::Time.constructor(to_time)
Schema = Dry::Validation.JSON do
optional(:sent_at, :time).value(ISOTime)
...
optional(:sent_at) { time? | value(ISOTime) }
?
I've found that, at least in my specific case,
each do
schema do
#some schema here
end
end
is not equivalent to
FunSchema = Dry::Validation.Schema do
# some schema here
end
# ... another schema
each do
schema(FunSchema)
end
PredefinedSchema = Dry::Validation.Schema do
required(:audience).filled(:str?)
end
ComparisonSchema = Dry::Validation.Schema do
%i(lt gt lte gte).each do |key|
optional(key).maybe { int? | float? | time? }
end
end
ParamSchema = Dry::Validation.Schema do
required(:to) do
str? & eql?('*') | schema(PredefinedSchema) | each do
schema do
required(:name).filled(:str?)
required(:criteria).each do
str? | int? | float? | time? | schema(ComparisonSchema)
end
end
end
end
end
CriterionSchema = Dry::Validation.Schema do
required(:name).filled(:str?)
required(:criteria).each do
str? | int? | float? | time? | schema(ComparisonSchema)
end
end
ParamSchema = Dry::Validation.Schema do
required(:to) do
str? & eql?('*') | schema(PredefinedSchema) | each do
schema(CriterionSchema)
end
end
end