FasterXML / smile-format-specification

New home for Smile format (https://en.wikipedia.org/wiki/Smile_(data_interchange_format))
BSD 2-Clause "Simplified" License
92 stars 14 forks source link

Clarification of the shared strings algorithm #21

Open vooft opened 3 months ago

vooft commented 3 months ago

Re https://github.com/FasterXML/jackson-dataformats-binary/issues/495

Some indexes must be skipped during the shared string handling, however the same values may be shared later. This logic must be replicated on both serializer and deserializer sides and thus should be documented.

cowtowncoder commented 2 months ago

Quick note: behavior is strictly speaking only needed on deserializer, unless I miss something: it is only encoder (serializer) that needs to avoid using specific potential back references. Deserializer may choose to report the issue of invalid use of back reference, or just allow use of such reference (assuming it keeps track of "unusable" values).

This does not change need for documentation, or recommendation that deserializer is aware of the issue.