-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
c3370f3
to
29ee927
Compare
if keys is not None: | ||
creation_params['properties']['policy_signing_certificates']['keys'] = keys | ||
if len(creation_params['properties']['policy_signing_certificates']) == 0: | ||
del creation_params['properties']['policy_signing_certificates'] |
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.
how about the length of properties.
factory['identity'] = {} | ||
factory['identity']['type'] = "SystemAssigned" | ||
if len(factory['identity']) == 0: | ||
del factory['identity'] |
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.
I don't think this is necessary given that identity must have a type with value "SystemAssigned" ?
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.
Yes. But it is hard to track this case.
if user_assigned_identities is not None: | ||
parameters['identity']['user_assigned_identities'] = user_assigned_identities | ||
if len(parameters['identity']) == 0: | ||
del parameters['identity'] |
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.
how about add some common logic to check all the empty dict in the build result instead of adding so much if XXX is not None. Is it more easier to do ?
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.
It is verbose. But I found it's hard to implement an easier way in current logic.
test/scenarios/synapse/output/ext_default_folder/src/synapse/azext_synapse/generated/custom.py
Show resolved
Hide resolved
6c9dfb5
to
39ac161
Compare
39ac161
to
7747f08
Compare
f6d3f86
to
be66820
Compare
Closed #860
Add if clause for optional parameters.
If the argument is optional, it will be assigned as parameter property when it is not None.
Previous Code
Current Code
Add logic to remove empty property of parameter.
If a property of parameter is optional and it is an empty dict, it will be removed from parameter.
Previous Code
Current Code