Allow empty string to represent apex records - #463
Conversation
|
@dallasread Who else do you recommend to review this PR? |
|
@kntsoriano have you tested that this behavior doesn't conflict with the update? We had this issue in the past, where forcing the empty name to always render, caused issues with updates where we update would reset all names to empty. This is because on update you can provide a partial changeset (e.g. only TTL), and name should be omitted. But after this change you always pass name which in this case would be empty, causing the update to also reset the name. Please make sure this change is not introducing bugs on updates. |
|
@weppos Thanks. I have not considered that and I will look into it tomorrow. |
Please let's make sure we have sufficient test coverage for all these cases. Tests should catch that. |
729385c to
6ffb59d
Compare
|
Thanks. I've updated the code to allow passing in an empty string We should be safe from the issue where a partial update clears the name as the default value of the I'm requesting another round of review. |
lokst
left a comment
There was a problem hiding this comment.
Thanks for the fix and adding the test!
dallasread
left a comment
There was a problem hiding this comment.
Looks good to me – thanks for adding the spec.
Fixes #451.
Description
When creating a
ZoneRecordInputandZoneRecordUpdateInputwithname='', theto_json()command omits thenameattribute because of theomitemptycommand. Theomitemptycommand removes empty strings by default.This PR changes the behavior to allow a name with an empty string to be rendered by the
to_jsoncommand. This name with an empty string represents an apex record.