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
Deleted fields are always recreated with use_kwargs #252
If one tries to
class GeojsonFeatureCollection(Schema): geotype = fields.String(required=True, location='json', load_from='type', validate=validate.OneOf(choices=['FeatureCollection'])) features = fields.List(fields.Dict()) @post_load def remove_geotype(self, data): data.pop('geotype') return data class Meta: strict = True
It works well with Marshmallow.
However, it is not working with webargs. For instance here, it will recreate the geotype member in the dictionary with the
I think one shoud be able retain in webargs the behaviour that Marshmallow provides so that the deleted fields would not be recreated by default if a flag is passed.
A simple solution would be to export the
Moreover, I am wondering why was it required to recreate all the missing fields if the arguments have to be inserted as keyword arguments ? Was it to avoid raising an error in the views methods in case one argument was missing ?