-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
naming strategy changes name provided in JSONPropertyAnnotation
copied from: http://stackoverflow.com/questions/22667964/jackson-pascal-case-and-jsonproperty-on-getter
the following test should pass but it fails
import static org.assertj.core.api.Assertions.assertThat;
import org.testng.annotations.Test;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
public class JsonFailureTest {
@Test
public void should_serialize_first_letter_lowercase() throws Exception {
String json = new ObjectMapper()
.setPropertyNamingStrategy(PropertyNamingStrategy.PASCAL_CASE_TO_CAMEL_CASE)
.writeValueAsString(
new Object(){
@JsonProperty("fooBar")
public String whatever() {return "";}
});
assertThat(json).contains("fooBar");
}
}
Metadata
Metadata
Assignees
Labels
No labels