-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-10058: Add SpEL JSON accessors and converter with Jackson 3 #10203
New issue
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
base: main
Are you sure you want to change the base?
Conversation
...egration-core/src/test/java/org/springframework/integration/json/JsonIndexAccessorTests.java
Outdated
Show resolved
Hide resolved
…ackson 3 Related to: spring-projects#10058 * Add `JsonNodePropertyAccessor` for reading JSON object properties * Add `JsonArrayNodeIndexAccessor` for array index access * Add `JsonNodeWrapperConverter` for type conversion between `JsonNodeWrapper` and `JsonNode` * Add `EmbeddedJsonMessageHeadersMessageMapper` for JSON message serialization with embedded headers * Deprecate Jackson 2 SpEL JSON accessors Signed-off-by: Jooyoung Pyoung <[email protected]>
* @since 7.0 | ||
* @see JsonNodePropertyAccessor | ||
*/ | ||
public class JsonArrayNodeIndexAccessor implements IndexAccessor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it (and all new classes) as JacksonIndexAccessor
!
That would be much easier for end-users to migrate.
And I anticipate a renaming back to Json
when we remove those deprecated classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about backward compatibility regarding the naming strategy.
If we rename JacksonIndexAccessor
back to JsonIndexAccessor
in the future (after removing deprecated classes), wouldn't this break backward compatibility for users who migrated to JacksonIndexAccessor
?
...ration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperConverter.java
Show resolved
Hide resolved
...va/org/springframework/integration/support/json/EmbeddedJsonMessageHeadersMessageMapper.java
Outdated
Show resolved
Hide resolved
...ation-core/src/test/java/org/springframework/integration/json/AbstractJsonAccessorTests.java
Outdated
Show resolved
Hide resolved
...egration-core/src/test/java/org/springframework/integration/json/JsonIndexAccessorTests.java
Outdated
Show resolved
Hide resolved
* Adopt more intuitive naming for Jackson 3 migration * Remove deprecated classes tests Signed-off-by: Jooyoung Pyoung <[email protected]>
* @author Jooyoung Pyoung | ||
* | ||
* @since 7.0 | ||
* @see JacksonPropertyAccessor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line after @since
.
I like to see sections in class JavaDoc separated.
* @author Artem Bilan | ||
* @author Paul Martin | ||
* @author Pierre Lakreb | ||
* @author Sam Brannen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, bring back all the names.
The class re-naming is not justification of taking authorship away.
@@ -60,7 +60,7 @@ | |||
* | |||
* @since 7.0 | |||
*/ | |||
class JacksonJsonObjectMapperTests { | |||
public class JacksonJsonObjectMapperTests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change, please?
JUnit Jupiter is good to work with non-public classes and methods.
Related to: #10058
JsonNodePropertyAccessor
for reading JSON object propertiesJsonArrayNodeIndexAccessor
for array index accessJsonNodeWrapperConverter
for type conversion betweenJsonNodeWrapper
andJsonNode
EmbeddedJsonMessageHeadersMessageMapper
for JSON message serialization with embedded headersI've prepared changes to deprecate other Jackson 2 classes and make 3 as the project default, but this involves several changes and discussion points. (I encountered an NPE in Jackson 3 logic that maybe needs to be fixed by the Jackson team, but I've implemented a workaround in our code.)
For this reason, I've kept it separate from the current Accessor PR and will address it in the upcoming PR.