Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support custom Schema class for argmap2schema #375
This could be done by passing the Schema class to the Parser constructor.
That way someone could use a custom Schema class that has a
I wouldn't mind sending a PR for this.
This makes sense. I have no objection.
It could be like
class Parser(object): DEFAULT_SCHEMA_CLS = ma.Schema def __init__(self, locations=None, error_handler=None, schema_cls=None): ... self.schema_cls = schemas_cls or DEFAULT_SCHEMA_CLS
This way it could be parametrized either by modifying the class attribute or by passing an init parameter.
If would be nice if we could settle on the rework in #374 before adding more features but I don't think the proposal here would be fundamentally broken by the rework, so it's not a blocker.
Since this is fully backwards-compatible I was hoping for this to make it into v5.2 if such a version happens to be released before 6.0 ;)
Is there a benefit to allow overriding this both on the class and instance level? If someone subclasses, they could already override the constructor and pass a custom default value there.
Sure, no problem. Sorry, I didn't mean to put #374 in the way. The feature you're talking about is a simple addition that could be shipped in a 5.2.
I was mimicking