@JsonProperty name with spaces

Viewed 2020

Is it allowed to have spaces in @JsonProperty name? i.e.

@JsonProperty("Jon Snow")
private String jonSnow = "Lord";

// getter & setter are omitted

I expect to get the following output:

{
   "Jon Snow" : "Lord"
}

But the actual result is:

{
   "jonSnow" : "Lord"
}

I use jackson-core v2.8.8, jackson-databind v2.8.8.1, and jackson-annotations v2.8.8.

1 Answers
Related