houdini/lib/generators/api/validator/templates/validator.rb.erb

6 lines
317 B
Text
Raw Normal View History

# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
class Houdini::V1::Validators::<%= name.camelcase %> < Grape::Validations::Base
def validate_param!(attr_name, params)
fail Grape::Exceptions::Validation, params: [@scope.full_name(attr_name)], message: 'MESSAGE'
end
end