-
Notifications
You must be signed in to change notification settings - Fork 5
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 type specifier #14
Comments
You could do this with a joi valiator |
I read the reply to the issue on tastypie-rethink, and the custom field type is a feasible option. In the linked issue you say
while I agree with you in a more broader sense, I think it's common in the majority of ORMs to pose some restriction on array elements' type. |
I see where you are coming from, I do. However, I think the most common use case is just parse out an array. It is the least invasive, least prone to error ( from a functional standpoint ), is the most performant, and leans heavily on Javascript's native behavior. Which is the way I think it should stay. I could see this a special filed type |
Is there an option to specify the type of elements in an array?
If not it should be added to fix a problem with the
match
filter in resource implementations liketastypie-rethink
.Here the match filter does not work if you declare the array type as string in thinky, and you pass a filter value that is coercible to number, for example
extCategories__match=123
.The only elegant way around this is to have an array type option and cast the filter value accordingly before passing it to the
match
filter.The text was updated successfully, but these errors were encountered: