I have some doubt about these changes, so I keep it as a undocumentated features so far. Basically, I change the name of the following decorators from Marshamallow:
- validates -> validate
- validates_schema -> validate_schema
pre_load -> before_load
post_load -> after_load
pre_dump -> before_dump
post_dump -> after_dump
Some ideas behind these changes:
validate and validate_schema are short and clear than validates and validates_schema. It also matches the validate keyword in field classes.
The change from pre_ to before_ and from post_ to after_ was trying to follow the name convention in Flask (before_request, etc.).
IMO, the new names are easier to understand and intuitive. However, this will definitely introduce "breaking" changes between APIFlask and Marshmallow. I can add a warning in the docs to inform users that they can continue to import everything from marshmallow, but notice the name changes if they want to import from APIFlask.
Is it a good or bad idea? Feel free to leave any thoughts.
I have some doubt about these changes, so I keep it as a undocumentated features so far. Basically, I change the name of the following decorators from Marshamallow:
pre_load -> before_loadpost_load -> after_loadpre_dump -> before_dumppost_dump -> after_dumpSome ideas behind these changes:
validateandvalidate_schemaare short and clear thanvalidatesandvalidates_schema. It also matches thevalidatekeyword in field classes.The change frompre_tobefore_and frompost_toafter_was trying to follow the name convention in Flask (before_request, etc.).IMO, the new names are easier to understand and intuitive. However, this will definitely introduce "breaking" changes between APIFlask and Marshmallow. I can add a warning in the docs to inform users that they can continue to import everything from marshmallow, but notice the name changes if they want to import from APIFlask.
Is it a good or bad idea? Feel free to leave any thoughts.