-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Revise the section on required / optional / nullable fields. #6468
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
Revise the section on required / optional / nullable fields. #6468
Conversation
|
please review |
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.
One other thing that I think would be good — in V1, all of this also applied for fields annotated as Any. It might be worth adding a note that this has changed as well — fields annotated as Any no longer have a default of None either.
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Co-authored-by: Serge Matveenko <lig@countzero.co>
Co-authored-by: Serge Matveenko <lig@countzero.co>
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.
👍🏻 looks top-notch
|
the second of these entries seems just to be a less-fully-explained copy of the first? | Not required, cannot be `None`, is `'abc'` by default | `f3: str = 'abc'` |
| Not required, cannot be `None` | `f4: str = 'Foobar'` | |
|
@dimbleby Nice catch. Thanks! Would you like making a PR?;) |
|
negative, sorry! |
|
I will follow up on this. Thanks for pointing it out @dimbleby Cheers |
Change Summary
Small enhancements to migration documentation – explicitly call out the breaking change of optional fields. (Related to #6463)
Note:
I created 2 alternative tables for demonstrating how fields are defined, cause I'm not sure which one we should go with. (Or, if we should keep it as a bullet pointed list. Or, if we should scrap it and just keep the code example below it.)
Checklist
Unit tests for the changes existTests pass on CI and coverage remains at 100%changes/<pull request or issue id>-<github username>.mdfile added describing change(see changes/README.md for details)
Selected Reviewer: @lig