Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect min/max attributes for serializers.ListField #6866

Merged
merged 2 commits into from Sep 3, 2019

Conversation

knivets
Copy link
Contributor

@knivets knivets commented Aug 11, 2019

Fixes #6862

Had to replace validators with a field argument in _map_field_validators because otherwise there is no way to test whether the field is a ListField or a CharField and we need to know this since they have different length attributes in OpenAPI spec.

@knivets knivets changed the title fixed incorrect min/max attributes for serializers.ListField Fixed incorrect min/max attributes for serializers.ListField Aug 11, 2019
@knivets
Copy link
Contributor Author

knivets commented Aug 20, 2019

@carltongibson could you please have a look at this PR? 😺

Copy link
Collaborator

@carltongibson carltongibson left a comment

Hi @knivets. Thanks for this. It's great.

(Makes me want to scream that they insist on both minItems and minLength, but that's a different topic... 😝)

@carltongibson carltongibson merged commit 1cc4be4 into encode:master Sep 3, 2019
1 check passed
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DRF generates incorrect attributes for serializers.ListField
2 participants