Skip to content

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

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

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

fabi125
Copy link
Contributor

@fabi125 fabi125 commented Jun 17, 2024

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.

Copy link
Contributor

github-actions bot commented Jul 3, 2024

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 github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jul 3, 2024
@netbox-community netbox-community deleted a comment from fabi125 Jul 3, 2024
@netbox-community netbox-community deleted a comment from fabi125 Jul 9, 2024
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fabi125!

@jeremystretch jeremystretch merged commit 4ea4e57 into netbox-community:develop Jul 12, 2024
3 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parent_device on Device is not marked as nullable in swagger api docs
2 participants