Skip to content

feat(api): Use JSONField for assigned_object serializer #248

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

Conversation

pheus
Copy link
Contributor

@pheus pheus commented Mar 21, 2025

Pull Request

Related Issue

Fixes: #247 [Housekeeping]: Use JSONField for assigned_object serializer

New Behavior

  • Replaces DictField with JSONField for assigned_object to align with NetBox best practices.
  • Ensures missing assigned_object returns None without errors.
  • Adds display to brief_fields for ACLInterfaceAssignment and improves its string representation.

Contrast to Current Behavior

  • Uses JSONField, which is the preferred approach in NetBox core.
  • Adds the display attribute to ACLInterfaceAssignment, ensuring consistency with other NetBox API objects.

Discussion: Benefits and Drawbacks

  • Benefits: Improves adherence to best practices, enhances consistency, and simplifies data handling.
  • Drawbacks: Minimal, as this is mostly a code cleanup.

Changes to the Documentation

  • None required (behavior remains functionally similar).

Proposed Release Note Entry

  • None required (internal improvement).

Double Check

  • I have explained my PR according to the information in the comments
    or in a linked issue.
  • My PR targets the dev branch.

Replaces DictField with JSONField for `assigned_object` to align with NetBox best practices.
Ensures missing `assigned_object` returns None without errors.
Adds `display` to `brief_fields` for ACLInterfaceAssignment and improves string representation.

Fixes: netbox-community#247
@cruse1977 cruse1977 merged commit 9462874 into netbox-community:dev Apr 20, 2025
6 checks passed
@pheus pheus deleted the housekeeping/247-use-jsonfield-for-assigned-object-serializer branch April 20, 2025 20:35
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.

[Housekeeping]: Use JSONField for assigned_object serializer
2 participants