-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(stepfunctions): renderObject
ignores explicit null
#17098
Conversation
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.
However,
null
andundefined
have different meanings in Typescript and it is possible for a user to want to pass an explicit null into the JSON path.
Yes but no. There is a difference between null
and undefined
in JavaScript, but there is not a difference between them in jsii (because Java does not have this distinction, Python does not have this distinction, etc).
So we can not rely on the fact that they are two different values in our TypeScript code.
The only correct way to deal with this is to change the API in such a way that the user has another ability to specify a null
(maybe an additional property, maybe a magic value) -- and it would be better to name it after the effect of specifying a null
, something like DROP_STATE
or something (not necessarily a great name, but I just want to indicate that it shouldn't be SPECIFY_NULL
: that doesn't tell anybody anything).
Sounds like a plan. I'm actually going to |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
I am facing this issue. |
Fixes #16253.
The stepfunctions module has a function
renderObject
that deep renders a JSON object to expand JSON path fields. Previously,renderObject
handlednull
values andundefined
values the same. However,null
andundefined
have different meanings in Typescript and it is possible for a user to want to pass an explicitnull
into the JSON path. For example:Previously would result in:
which completely ignores the
null
parameter. Now, this results in:which is the expected behavior.
This PR builds on what was started in #16721.
There is also a bug (I believe) in how we specify
notificationProperty
forGlueStartJobRun
andRunGlueJobTask
inaws-stepfunctions-tasks
. The default value is specified asnull
and notundefined
, which I think is typically how we specify non-existent properties in Typescript.❗ I am not sure if
notificationProperty
is some sort of exception to this rule ❗, but I have looked at the documentation for it and nothing seems to suggest that thenull
value was intentional. It was introduced in this PR as well as this one.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license