automerge / automerge-swift

Swift language bindings presenting Automerge

Home Page:https://automerge.org/automerge-swift/documentation/automerge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

targeted encode with AutomergeEncoder "cleans up" too aggressively

heckj opened this issue · comments

The update with #54 causes a rather unfortunate side effect with the AutomergeEncoder method encode<T: Encodable>(_ value: T, at path: [CodingKey]). The goal of this particular API is to allow a far more targeted encoding of values into an Automerge document, but the new cleanup removes keys and array elements around the pathing that isn't written.

The implementation behind this API should be updated to only clean up the portion of the Automerge document that matches elements from the path provided and lower within the document.