Skip to content

Conversation

@esafak
Copy link
Contributor

@esafak esafak commented Jul 30, 2025

  • Introduced SerializationOptions object with dropNull and dropDefault fields.
  • Updated toJson and dumpHook procedures to accept options parameter.
  • Implemented shouldDropNull to determine if a value should be omitted.
  • Modified object dumping to skip fields with null or default values based on options.
  • Enhanced dumpHook for objects and tuples to respect dropNull and dropDefault.
  • Added tests verifying behavior with different serialization options.
  • Improved code readability and consistency in JSON serialization logic.
  • Completed some half-implemented existing tests

Closes #49

Note

  • I suggest incrementing the version to avoid breaking clients.
  • Master is broken for me; I had to fix several existing tests

- Introduced `SerializationOptions` object with `dropNull` and `dropDefault` fields.
- Updated `toJson` and `dumpHook` procedures to accept options parameter.
- Implemented `shouldDropNull` to determine if a value should be omitted.
- Modified object dumping to skip fields with null or default values based on options.
- Enhanced `dumpHook` for objects and tuples to respect dropNull and dropDefault.
- Added tests verifying behavior with different serialization options.
- Improved code readability and consistency in JSON serialization logic.

Closes treeform#49
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.

Leave out object fields that have a null value

1 participant