feat(core): MessagePack serialization (toMsgPack, path instead of ref, no nulls) #60
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core!60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/msgpack-serialization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
MessagePack C# clients (totalymage/Application#2) cannot use
ref(C# reserved keyword) and misreadnullvalues. Required by totalymage/backend#208.Changes
ObjectUri.toMsgPack():{ path, label, backend? }, derived fromtoJSON()through the static helperObjectUri.toMsgPackReference()(renamesreftopath).AbstractObject.toMsgPack(): delegates touri.toMsgPack().DataObject.toMsgPack(params): same output astoJSON(params)(single shared_serialize()), withignoreNullsforced (null keys are omitted) andrefrenamed topathonObjectPropertyvalues.DataObject.populateFromData()also accepts{ path, label }as input (payloads sent by MessagePack clients).toMsgPack()added to theDataObjectType/DataObjectClassinterfaces.No duplication of
_dataToJSON:PersistedDataObjectinherits the behaviour unchanged.Tests
ObjectUri.toMsgPack()(with backend)BaseObject/DataObject:pathinstead ofref, null omission,{ path, label }accepted as inputpackages/coreandpackages/backendsuites green, exceptMockAdapter.test.tswhich already fails ondevelop(broken@quatrain/core/srcimport).Out of scope (separate ticket)
PersistedDataObject._dataToJSONusesprop.val() || null:0,''andfalsebecomenull(and are therefore omitted in MessagePack).🤖 Generated with Claude Code
https://claude.ai/code/session_015r3zvThmkuw3hwy2db1pyg
- Add toMsgPack() on ObjectUri (@quatrain/types) returning { path, label } (and backend if defined) to avoid colliding with the C# reserved keyword 'ref' - Add toMsgPack() on AbstractObject, DataObject, BaseProperty, ObjectProperty, MapProperty (@quatrain/core) and PersistedDataObject (@quatrain/backend) - Support hydrating ObjectUri from { path, label } references in DataObject.populateFromData() - Add unit tests for ObjectUri.toMsgPack(), BaseObject.toMsgPack(), and DataObject.toMsgPack()