Closed imohuan closed 4 years ago
ts-node
执行代码
版本"json2typescript": "^1.4.1",
Hello @imohuan and thank you for your question!
I think everything is correct except a little detail:
Important note: You must assign any (valid) value or undefined to your property at initialization, otherwise our mapper does not work and will simply ignore the property.
(from the docs)
Try this and it should work:
@JsonObject("User")
class User {
@JsonProperty("username", String)
username: string = "";
@JsonProperty("password", String)
password: string = "";
}
Maybe I didn't see it
return
I wrote it against the official code? What did I do wrong?
Why ?