I am attempting to use grape-entity as a request body for PUT, POSt, PATCH. It seems this is the best way to get param_type body as the `params` block does not currently support that neatly (i.e.: arrays). However when doing something like the code below there is no validation happening. What is the recommended way to get both (validation and `body` param type)? I came across this related StackOverflow question
https://stackoverflow.com/questions/29517362/grape-required-params-with-grape-entity but there does not seem to be a consensus on how this should work.
module Api
class Accounts < Grape::API
desc 'createTestAccount',
params: Entity::Accounts.documentation
post 'create' do
JSON(params)
end
end
end