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

12278 add ipaddressfield serializer for OpenAPI spectacular typing #12285

Merged
merged 10 commits into from
Apr 21, 2023

Conversation

arthanson
Copy link
Collaborator

@arthanson arthanson commented Apr 18, 2023

Fixes: #12278

Creates a serializer for the IPAddressField so typing works correctly for OpenAPI eliminating warnings over the type (the default schema overrides weren't working for this). It's defined in nestedserializers due to scoping (serializers include nestedserializers).

@arthanson arthanson changed the title DRAFT: 12278 ipaddressfield serialize 12278 add ipaddressfield serializer for OpenAPI spectacular typing Apr 18, 2023
@arthanson arthanson marked this pull request as ready for review April 18, 2023 19:39
@arthanson
Copy link
Collaborator Author

@jeremystretch this should be ready, moved IPAddressField serializer to separate file. I didn't find an auto field mapper for DRF, the closet I found was this discussion (encode/django-rest-framework#3244) but doesn't look like something we would want to do (monkey patching ModelSerializer) as "No, the recommended way is to just specify the field on the serializer class - not a big deal."

@jeremystretch
Copy link
Member

I didn't find an auto field mapper for DRF

Ack. I must have been thinking about something else; probably django-filters. Apologies for the wild goose chase!

@jeremystretch jeremystretch merged commit 55385dd into feature Apr 21, 2023
@jeremystretch jeremystretch deleted the 12278-ipaddressfield-serialize branch April 21, 2023 16:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants