Closed
Description
When a default/missing value is a callable, it is called when generating the documentation.
if default is not marshmallow.missing:
if callable(default):
ret['default'] = default()
else:
ret['default'] = default
This can be wrong if the value of the callable depends on the moment it is called. Typically, if it is dt.datetime.now
. There should be an opt-out for this allowing to specify an alternative text to write in the docs.
Not sure how to do that. Maybe a default_doc
attribute in the Schema that would take precedence over default/missing.