Skip to content

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

@regoawt

Description

@regoawt

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

Activity

IATF

IATF commented on Feb 17, 2022

@IATF
changed the title [-]`style` not included in utils.get_field_kwargs(); not aligned to DRF core arguments[/-] [+]`style` not included in `utils.get_field_kwargs()`; not aligned to DRF core arguments[/+] on Feb 17, 2022
linked a pull request that will close this issue on Feb 17, 2022
BurkovBA

BurkovBA commented on Feb 17, 2022

@BurkovBA
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @BurkovBA@IATF@regoawt

      Issue actions

        `style` not included in `utils.get_field_kwargs()`; not aligned to DRF core arguments · Issue #288 · umutbozkurt/django-rest-framework-mongoengine