samson icon indicating copy to clipboard operation
samson copied to clipboard

Support for unmarshalling to reference types

Open auxym opened this issue 4 years ago • 2 comments

Is it planned to implement support for unmarshalling to reference (ref object) types? Example based on the README:

import samson

type User = ref object
    name: string
    age: range[0..high(int)]

let input = """
[
    {"name": "John Doe", age: 25},
    {"name": "Jane Doe", age: 22, timezone: "Europe/Stockholm"}
]
"""

let parsed = fromJson5(input, seq[User])

Currently this fails with : "Unsupported type: User".

auxym avatar Oct 25 '19 22:10 auxym