-
Notifications
You must be signed in to change notification settings - Fork 497
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
NAS-133728 / 25.10 / Add NotRequired
default value to our API
#15462
Conversation
NotRequired
default value to our APINotRequired
default value to our API
424f59f
to
2f8e339
Compare
NotRequired
default value to our APINotRequired
default value to our API
ping @themylogin what do you think? I like this idea. I believe it will become valuable when we start migrating APIs like our network plugin 😬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do integration tests pass with these changes?
JIRA ticket https://ixsystems.atlassian.net/browse/NAS-133728 is targeted to the following versions which have not received their corresponding PRs: 25.10 |
This PR has been merged and conversations have been locked. |
Pydantic does not allow named fields to be omitted entirely from models; in order for a field to be not required, it must have a default.
NotRequired
default value is a workaround to the problem. Any fields that are set toNotRequired
will be excluded from model serialization.Example:
http://jenkins.eng.ixsystems.net:8080/job/tests/job/api_tests/2702/