You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it's not possible to annotate a function with @JsonProperty and have it be included in the json.
For example, following kotlin code will be serialized into an empty json object:
classObj {
val name
get() ="John Doe"
}
If @JsonProperty would be allowed for methods, we could write the above code as follows:
classObj {
@get:JsonProperty("name")
val name
get() ="John Doe"
}
And have it be included in the serialized form. Alternatively, the serialization could include all getters by default. Jackson's ObjectMapper does the same:
classObj {
val name
get() ="John Doe"
}
println(ObjectMapper().writeValueAsString(Obj()))
prints
{"name":"John Doe"}
The text was updated successfully, but these errors were encountered:
Right now it's not possible to annotate a function with
@JsonProperty
and have it be included in the json.For example, following kotlin code will be serialized into an empty json object:
If
@JsonProperty
would be allowed for methods, we could write the above code as follows:And have it be included in the serialized form. Alternatively, the serialization could include all getters by default. Jackson's ObjectMapper does the same:
prints
The text was updated successfully, but these errors were encountered: