automerge / automerge-swift

Swift language bindings presenting Automerge
https://automerge.org/automerge-swift/documentation/automerge/
MIT License
217 stars 11 forks source link

Adds support to encode & decode Foundation.URL #136

Closed lightsprint09 closed 3 months ago

lightsprint09 commented 3 months ago

No worries, would have guessed the same. I am currently migrating from the old automerge to the new one and discovered it did not work as expected.

heckj commented 3 months ago

yeah, just double checked and URL is definitely Codable - I'm guessing this was because you wanted a specific in-automerge-schema representation for it? That plain string?

When I coded it (prior to this PR) and dumped the schema, I got:

      "url" : {
        {
        "relative" :String(https://automerge.org/)
        }
      }
lightsprint09 commented 3 months ago

Right, I would expect. This is how JSONDecoder/Encoder handle an URL

"url" : String(https://automerge.org/)