django-rest-framework-mongoengine icon indicating copy to clipboard operation
django-rest-framework-mongoengine copied to clipboard

`style` not included in `utils.get_field_kwargs()`; not aligned to DRF core arguments

Open regoawt opened this issue 3 years ago • 2 comments

Currently, if style is defined as a kwarg on a mongoengine field, utils.get_field_kwargs() method does not build the DRF serializer field with it. To achieve this one has to wrap serializers.build_field() and update the field_kwargs dictionary, which seems unnecessary?

Is this intended behaviour?

The style argument is listed as a DRF 'core argument' on the base serializer field: https://www.django-rest-framework.org/api-guide/fields/#core-arguments

regoawt avatar Feb 17 '22 15:02 regoawt

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

IATF avatar Feb 17 '22 15:02 IATF

@regoawt Hello.

I might be wrong, but I feel like style is a relatively new field in DRF.

Thank you for your PR .Please, add unit-tests to your changes, so that we could ensure their correctness.

BurkovBA avatar Feb 17 '22 17:02 BurkovBA