You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I haven't found a clean way to do this with normal container decoding and XMLCoder. What I am currently doing is using a stand-in struct with NodeEncoding that's basically private to SomeType and just used to decompose the xml structure and somewhat awkwardly transform it into a dictionary inside init(from decoder: Decoder):
This might be more general Codable related problem. Please let me know if you think it's beyond the scope of this project.
I have some xml data that looks like this:
Which seems to me would be most fitting to decode into a dictionary, like
Inside the parent struct:
However, I haven't found a clean way to do this with normal container decoding and XMLCoder. What I am currently doing is using a stand-in struct with
NodeEncoding
that's basically private toSomeType
and just used to decompose the xml structure and somewhat awkwardly transform it into a dictionary insideinit(from decoder: Decoder)
:I was wondering if there's a better approach to decoding dictionary-like xml structures like these.
The text was updated successfully, but these errors were encountered: