Hi everyone
I have a params class
module MyApp
module Actions
module Document
module Params
class Create < Hanami::Action::Params
params do
required(:title).filled(:string)
required(:template).filled(:string)
optional(:type).value(:string)
optional(:number).value(:string)
end
end
end
end
end
end
I use this schema in my action
params Params::Create
I would like to compose in my another action
params Params::Create
optional(:documents).value(:array, min_size?: 1).each do
schema(Params::Create)
end
end
I have tried several attempts but without success
Also, as I see, It is impossible to pass array without root and validate it
e.g.
using:
[
{}, {}
]
instead of
{
documents: []
}