Skip to content

Deprecate MarshalJSON, add IsZero methods#13

Merged
jonathansharman merged 4 commits intomainfrom
feature/omitzero
Feb 17, 2025
Merged

Deprecate MarshalJSON, add IsZero methods#13
jonathansharman merged 4 commits intomainfrom
feature/omitzero

Conversation

@jonathansharman
Copy link
Contributor

@jonathansharman jonathansharman commented Feb 12, 2025

Dependencies

None.

Documentation

DELTA-1229: Update nullable docs with regard to omitzero

Description

  • Updates documentation to recommend using omitzero + json.Marshal for nup.Update and nup.SliceUpdate struct fields
  • Deprecates nup.MarshalJSON, which because of omitzero is no longer needed
  • Adds IsZero methods to nup.Update and nup.Update and nup.SliceUpdate. This was not strictly necessary since no-op updates were already zero-valued, but this makes it explicit.
  • Uses the expect package to simplify existing unit tests

Testing Considerations

Tested via unit tests and https://github.com/nicheinc/entity/pull/342.

Versioning

Minor - adds new symbols.

@jonathansharman jonathansharman marked this pull request as ready for review February 13, 2025 00:04
Copy link

@angelowilliams angelowilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jonathansharman jonathansharman merged commit a1ff86e into main Feb 17, 2025
3 checks passed
@jonathansharman jonathansharman deleted the feature/omitzero branch February 17, 2025 19:27
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.

2 participants