We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I should be able to use the JsonPath and JsonProperty annotations on the property accessors on a class that follows JavaBean conventions.
I used the following test to determine that this functionality is not supported.
@Test void 'In multi-level structure, with annotated setters must be unmarshalled correctly'() { def returnObject = new TestMultiLevelsWithAnnotatedAccessors() given(classInstantiator.newInstance(TestMultiLevelsWithAnnotatedAccessors)) .willReturn(returnObject) def result = factory.unmarshall(TestMultiLevelsWithAnnotatedAccessors, multiLevelJson) def secondLevelNonAnnotated = result.getSecondLevelNonAnnotated() assert null != secondLevelNonAnnotated // ============ assert third level ======================= def thirdLevelJProperty = secondLevelNonAnnotated.getThird_level() assert null != thirdLevelJProperty assert '3rd field1[1]' == thirdLevelJProperty.absoluteJsonPath }
I created the following test class for use with this test
public class TestMultiLevelsWithAnnotatedAccessors { private SecondLevelWithAnnotatedAccessor secondLevelNonAnnotated; @JsonProperty("second_level") public void setSecondLevelNonAnnotated(final SecondLevelWithAnnotatedAccessor secondLevelNonAnnotated) { this.secondLevelNonAnnotated = secondLevelNonAnnotated; } public SecondLevelWithAnnotatedAccessor getSecondLevelNonAnnotated() { return secondLevelNonAnnotated; } /** * Test class. */ public static final class SecondLevelWithAnnotatedAccessor { //CHECKSTYLE:OFF private ThirdLevelWithJsonPath thirdLevelWithJsonPath; //CHECKSTYLE:ON @JsonProperty("third_level") public void setThirdLevelWithJsonPath(final ThirdLevelWithJsonPath thirdLevelWithJsonPath) { this.thirdLevelWithJsonPath = thirdLevelWithJsonPath; } public ThirdLevelWithJsonPath getThird_level() { return thirdLevelWithJsonPath; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I should be able to use the JsonPath and JsonProperty annotations on the property accessors on a class that follows JavaBean conventions.
I used the following test to determine that this functionality is not supported.
I created the following test class for use with this test
The text was updated successfully, but these errors were encountered: