-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array params with at_least_one_of having custom validation message #396
Comments
I have added a test showing the failure in this PR #397 . This will be fixed when grape is updated to 0.16.2 |
thanks for the spec PR … but it is a more general problem: how should the grape validation specials, such |
I also think the validation specials cannot be mapped to swagger. Grape has it's validation special and is also flexible to make custom validation special. So these all cannot be handled. I think we should only consider The above issue is actually when we pass message as a param in the validation specials ( |
yeap, that is my meaning, at the moment, we can only support and how should it look like? at the moment I'm on refactoring, so other could easy dive in … |
I simply updated the gem and ran the test nothing more. |
When we have array as a params with elements and a validation like at_least_one_of, mutually_exclusive, ... the generated JSON has an extra field which is undesired. This field is present only when we have a custom message filed passed in the validation (
message: 'is missing'
)The generated JSON is:
The last field
my_top_arr[][{:message=>\"is missing\"}]
seems to be extra generated.This field is generated only when i pass message: 'is missing' to the at_least_one_of validation.
*The message key is used by grape for custom validation message.
The text was updated successfully, but these errors were encountered: