Project

Profile

Help

Issue #3785

Updated by dkliban@redhat.com 8 months ago

In https://github.com/pulp/pulp/pull/3531 we added extra validation such that if extra parameters that are not defined are passed to the serializer, it will raise a `serializers.ValidationError`.

The For plugin API documentation is missing a description for ModelSerializer.validate()[0]. Plugin writers would benefit to get the same validation when inheriting from knowing the type `base.ModelSerializer` they will have to call `super().validate(data)` from their serializer, or if they inherit from a serializer that isn't a subclass of validation provided by pulpcore.

[0] https://docs.pulpproject.org/en/pulpcore-plugin/nightly/api-reference/serializers.html#pulpcore.plugin.serializers.ModelSerializer.validate
`base.ModelSerializer` they can call `base.validate_unknown_fields(initial_data, defined_fields)` themselves.

Back