The decoder API functions let you read JSON data from a string or a file. The data are stored in a decoder tree that reflects the hierarchy of the JSON fields. You can navigate the tree by pushing into and popping out of objects and arrays, moving to the next and previous object properties or array elements, and jumping to a specific property or node index.
You can create a special-purpose encoder for adding or changing values within the decoder tree. To keep track of when the contents change, you can read and store the current data version, which increments whenever the content is modified, or the decoder is reset or cleaned up.