-
Notifications
You must be signed in to change notification settings - Fork 73
Input object null vs undefined #87
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
Conversation
This allows input types to differentiate between fields that were defined as null or undefined
@NeedleInAJayStack great work! We really needed this. |
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.
Everything looks good to me. Would be nice to check for other instances of Map?
elsewhere in the codebase and reason if using undefined
would make sense. I was reluctant about adding an undefined
case before, but now I think we should've had it all along.
For more details, see: actions/runner-images#3287
@paulofaria I removed the OrderedCollections import and removed the ubuntu-16.04 CI because it's been removed. Mind approving again after these changes? |
Done! |
@paulofaria Argh, since the ubuntu 16-04 test started and never completed, I can't merge it (even though I removed it for the future). If you could merge, I'll tag and release! |
This adds support to differentiate between explicitly providing the literal value null and implicitly not providing a value at all, as described in the spec here and here.
To do so, an
undefined
case is added to the Map enum, and argument parsing uses this value when expected arguments are not provided. Field default values now override only undefined maps.The end result is that Map encoding works like JSON where a field with a literal
null
is contained by the decoding container, whereas an un-provided value is not. From here, custom object decodings can adjust functionality based on the two situations. For example: