netbox
netbox copied to clipboard
Fixes #16624: Set allow_null=True on method fields that can return None
Fixes: #16624
Noticed that Device.parent_device was not marked as nullable in the swagger api docs. Went through all uses of SerializerMethodField and added allow_null=True if the method could return None.
I opted to add it to the @extend_schema_field decorator where possible because that's how allow_null was set on other methods that could return None.
This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.