-
Notifications
You must be signed in to change notification settings - Fork 263
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
Swagger UI Doesn't Report Status as a Required Field Correctly #313
Comments
Thanks @nniehoff for reporting this. Interestingly it's marked as non-required field in the serializer mixin, but obviously that's now how it is behaving: https://github.com/nautobot/nautobot/blob/develop/nautobot/extras/api/serializers.py#L873-L876 |
It's because of model validation. The field not being required is overridden by the fact that the field is required when the model is validated. |
Updating the link: https://github.com/nautobot/nautobot/blob/develop/nautobot/extras/api/serializers.py#L873 (StatusModelSerializerMixin). It probably should be |
Not sure if this is global or specific to power-feeds status but I also checked devices and status is not required there either in swagger.
Environment
Steps to Reproduce
POST /dcim/power-feeds/
Expected Behavior
Status should have a required * as it is a required field.
Observed Behavior
Swagger shows it as not required
The text was updated successfully, but these errors were encountered: