Skip to content

Can not parse seq of Components #11

@planetis-m

Description

@planetis-m
import eminim, streams

type Component = ref object of RootObj
type Move = ref object of Component
  speed: float32
let s = newStringStream("""{"speed":20}""")
let a = Move(s.jsonTo(Component))
echo a.speed

From the marshal module docs:

Restriction: For objects, their type is not serialized. This means essentially that it does not work if the object has some other runtime type than its compiletime type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions