17 lines
447 B
Ruby
17 lines
447 B
Ruby
module Adamantium
|
|
module Validation
|
|
module Posts
|
|
class PostContract < Dry::Validation::Contract
|
|
params do
|
|
required(:name).maybe(:string)
|
|
required(:content).filled(:string)
|
|
required(:category).array(:string)
|
|
required(:published_at).maybe(:time)
|
|
required(:slug).filled(:string)
|
|
required(:post_type).value(included_in?: %w[post])
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|