Skip to content

Conversation

@kemoycampbell
Copy link

Previously the error would read, "Parameter cannot be less ... " but this is not helpful as it is too generic and could be from any of the parameters.
I added name field to the function validate!(param, options, name) then it is called as validate!(params[name], options, name) inside the def param function. The error message is updated inside the validation function as "The parameter #{name} ... "
since name is already supported there.

Previously the error would read, "Parameter cannot be less ... " but this is not helpful as it is too generic and could be from any of the parameters.
I added name field to the function validate!(param, options, name) then it is called as validate!(params[name], options, name) inside the def param function 
since name is already supported there.
@niekvenlo
Copy link

This would be nice addition. You may also want to update the spec, so that tests don't start failing:
spec/parameter_validations_spec.rb, for example, compares responses to strings like "Parameter is required"

@kemoycampbell
Copy link
Author

@niekvenlo, good catch. I have updated the specs with the correct responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants