kim icon indicating copy to clipboard operation
kim copied to clipboard

Only one invalid field at a time

Open kirknorthrop opened this issue 8 years ago • 1 comments

Currently only one invalid field can be reported at the time, because an exception is raised immediately after calling .invalid()

It would be helpful if more than one could be reported at a time, with the raise happening later on.

https://github.com/mikeywaites/kim/blob/release/1.0.0-beta/kim/field.py#L222

kirknorthrop avatar Dec 19 '16 14:12 kirknorthrop

@kirknorthrop Can you remember the specific Mapper setup you had when you came across this?

As I understand it what you're actually proposing here is that we should process all errors for a field and not just error at the first?

class MyMapper(Mapper)
    field_one = field.String(required=True)
    field_two = field.Integer(extra_marshal_pipes={"validation": [int_less_than_10]})

Given the above mapper and the following data {'field_two': "ten"} is the suggestion that i should have all the errors for each field

field one * field is required, field is not a valid string etc ? field two * field is not an integer, field it not less than 10?

I'm probably completely misunderstanding

mikeywaites avatar Jul 19 '17 19:07 mikeywaites