这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@BenEmdon
Copy link
Contributor

@BenEmdon BenEmdon commented Sep 6, 2017

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 use inputType.unsetProperty() instead.

  • Generated supporting schema
  • Added tests
  • Change results in no API breakage

}

// Unsets the <%= escape_reserved_word(field.camelize_name) %> property so that it is not serialized
public void unset<%= field.classify_name %>() {
Copy link
Contributor

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.

Copy link
Contributor Author

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 ☝️

Copy link
Contributor

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.

@wesleyjellis
Copy link

This looks good, but the test failures seem to be legitimate

@BenEmdon BenEmdon merged commit cb786c4 into master Sep 7, 2017
@BenEmdon BenEmdon deleted the clear-nullable-input branch September 7, 2017 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants