-
Notifications
You must be signed in to change notification settings - Fork 39
Add a way to unset an input property #29
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
@@ -286,6 +286,12 @@ public class <%= schema_name %> { | |||
this.<%= escape_reserved_word(field.camelize_name) %> = <%= escape_reserved_word(field.camelize_name) %>; | |||
return this; | |||
} | |||
|
|||
// Unsets the <%= escape_reserved_word(field.camelize_name) %> property so that it is not serialized | |||
public void unset<%= field.classify_name %>() { |
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 doesn't make sense to have this method for required fields, as is the case here.
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.
Makes sense so I fixed this.
This comment was on the optional field generator ☝️
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.
originally the comment was for required fields, but github moved it after that got removed.
This looks good, but the test failures seem to be legitimate |
This PR
In this PR I am adding a way to unset properties so that they aren't serialized. This change is required because currently there is no way to tell a property to not serialize.
This is aimed to help consumers of this generator that were effected by the change #28 that used to reset their input types with
inputType.setProperty(null)
so that they can useinputType.unsetProperty()
instead.