decodeJson

Decode a JSON string into some datatype.

T
decodeJson
(
T
)
(
string json
)

Examples

1 struct User {
2   @JsonProperty("user_name") string userName;
3 }
4 
5 string json = `{"user_name": "John Smith"}`;
6 auto decoded = json.decodeJson!User;
7 assert(decoded == User("John Smith"));

Meta