Open
Description
I'm attempting was attempting to define a re-usable params type and make use of it for a request. The result is I get this: NameError (uninitialized constant Grape::Validations::Types::SymbolCoercer)
.
Here is my re-usable param structure:
helpers do
params :identifier_type do
optional :id, type: String
optional :name, type: String
exactly_one_of :id, :name
end
end
Since there was no clear examples in the docs of how to go about it, I was trying things like this - which just gave me errors.
params do
required :identifier, type: :identifier_type
end
post '' do
...
end
Eventually, I found a pattern that works:
params do
required :identifier, type: Hash do
use :identifier_type
end
end
post '' do
...
end
Adding something like this to the documentation would be helpful for others, I think