marshmallow
marshmallow copied to clipboard
To customize the error message for required fields, pass a dict with a required key as the error_messages argument for the field.

https://github.com/marshmallow-code/marshmallow/commit/278ff691f2e4de0bba6368ca05ccd4ba3dd92abe#diff-c9a9d6773bfb8f6a209256e8f1dc00db3eca97be188d9541607f55ca4f9744d1R248
https://github.com/marshmallow-code/marshmallow/commit/5a933dc882e21af5e94a50bb99f62261cc8566a0#diff-0cddc4aac0e4e16946830a5807c264d65b7f14a2a1b1cb23b03028a36df3681aR156
The type annotations did not match the docs when they were added. I suspect we want to use the same type signature that ValidationError accepts for the message arg. I suspect there are enough args that end up getting passed to ValidationError that we should consider making a type alias for this.
https://github.com/marshmallow-code/marshmallow/blob/6c4a423/src/marshmallow/exceptions.py#L30