Skip to content

Support for serialization and deserialization of JSON #292

Open
@willemolding

Description

@willemolding

Given the strong type requirements of AS it would be ideal to be able to parse a JSON string directly into a given class. A decorator could be used to generate the serialize/deserialize functionality on the class at compile time.

@serializable
@deserializable
class T {
  x: i32
  y: string
}

let obj: T = JSON.parse<T>(jsonStr)

This would return an error code if jsonStr is invalid or not deserializable to the class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions