martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
405 stars 23 forks source link

Add callbacks to schema handler #115

Closed treagod closed 1 year ago

treagod commented 1 year ago

This commit adds the callbacks before_schema_validation, after_schema_validation, after_successful_schema_validation and after_failed_schema_validation.

Closes #111

treagod commented 1 year ago

I'm thinking about turning Schema#process_valid_schema and Schema#process_invalid_schema private. What do you think?

ellmetha commented 1 year ago

I'm thinking about turning Schema#process_valid_schema and Schema#process_invalid_schema private. What do you think?

I think we should leave those methods public as they are still heavily documented and leveraged in automatically-generated projects (eg. those using the built-in authentication). I think we can avoid introducing breaking changes by keeping them public, plus I don't see any issues with those being public since some advanced users could still want to override them. 🙂