Skip to content

Conversation

@rickwierenga
Copy link
Member

Summary

  • Add apply_merge_patch(), create_merge_patch(), and compact() to serializer.py implementing RFC 7386 JSON Merge Patch
  • compact() strips fields matching constructor defaults from serialized resource trees, producing smaller JSON
  • Resource.save() now emits compact format automatically
  • All deserialize() methods (12 files) updated to tolerate missing optional fields, so both old full-format and new compact-format JSON load correctly
  • deserialize() in the core serializer now fills missing params from __init__ defaults before calling constructors

Test plan

  • 34 new/updated tests in serializer_tests.py covering apply_merge_patch, create_merge_patch, compact, and round-trip deserialization
  • All 563 existing tests pass unchanged
  • Verified old full-format JSON still deserializes correctly (backward compat)
  • Verified compact JSON with missing optional fields deserializes correctly
  • Verified Resource.save()Resource.load_from_json_file() round-trip

🤖 Generated with Claude Code

Add apply_merge_patch(), create_merge_patch(), and compact() to the
serializer. compact() strips fields matching constructor defaults from
serialized resource trees, producing smaller JSON without losing
information. Resource.save() now emits compact format. All deserialize()
methods tolerate missing optional fields so both old full-format and new
compact-format JSON load correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rickwierenga
Copy link
Member Author

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.

1 participant