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

Warning on schema generation for IPAddressField #12278

Closed
arthanson opened this issue Apr 17, 2023 · 0 comments
Closed

Warning on schema generation for IPAddressField #12278

arthanson opened this issue Apr 17, 2023 · 0 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application type: housekeeping Changes to the application which do not directly impact the end user

Comments

@arthanson
Copy link
Collaborator

Proposed Changes

Should silence warning for IPAddressField on drf-spectacular openAPI 3.

Generate schema using, e.g.

./netbox/manage.py spectacular --color --file schema.json --validate --format openapi-json

Warning [IPRangeViewSet > IPRangeSerializer]: model field "IPAddressField" has no mapping in ModelSerializer. It may be a deprecated field. Defaulting to "string"

Justification

There should be no warnings produced by default if possible.

@arthanson arthanson added type: housekeeping Changes to the application which do not directly impact the end user beta Concerns a bug/feature in a beta release labels Apr 17, 2023
@arthanson arthanson self-assigned this Apr 17, 2023
@arthanson arthanson added the type: bug A confirmed report of unexpected behavior in the application label Apr 18, 2023
arthanson added a commit that referenced this issue Apr 18, 2023
arthanson added a commit that referenced this issue Apr 20, 2023
@arthanson arthanson added the status: accepted This issue has been accepted for implementation label Apr 21, 2023
jeremystretch pushed a commit that referenced this issue Apr 21, 2023
…12285)

* #12278 add serializer for ipaddressfield to remove spectacular warnings

* #12278 add ipaddressfieldserializer to nested serializers

* #12278 fix to_internal_value to_representation in serializer

* #12278 to_internal_value is called before validation! need to raise validation error if incorrect format

* #12278 to_internal_value needs to return value doh

* #12278 move IPAddressField to field_serializers

* #12278 remove old import

* 12278 remove validator
jeremystretch added a commit that referenced this issue Apr 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

2 participants