ml-archive / Serpent

A protocol to serialize Swift structs and classes for encoding and decoding.

Home Page:https://nodes-ios.github.io/Serpent/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for mapping nested values

dominik-hadl opened this issue · comments

This might be useful in cases where we don't need to parse a whole nested object and just care about one value.

For example:

JSON

{
    "name": "Your name",
    "times": {
        "createdAt": "some time",
        "updatedAt": "some time",
        "deletedAt": "some time"
    }
}

Model

struct User {
    var name = ""
    var createdAt = Date() // <-times/createdAt
}

I have implemented this. Needs review.

Implemented in #156.