decodeJson

Decode a JSON string into some datatype.

T
decodeJson
(
T
)
(
string json
)

Examples

struct User {
  @JsonProperty("user_name") string userName;
}

string json = `{"user_name": "John Smith"}`;
auto decoded = json.decodeJson!User;
assert(decoded == User("John Smith"));

Meta