netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Fixes #16624: Set allow_null=True on method fields that can return None

Open fabi125 opened this issue 1 year ago • 2 comments

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.

fabi125 avatar Jun 17 '24 14:06 fabi125

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.

github-actions[bot] avatar Jul 03 '24 04:07 github-actions[bot]