Skip to content

Commit daf3e37

Browse files
authored
Doc : Resolve #4570 explain more on ObjectMapper.canDeserialize()/ObjectMapper.canSerialize() deprecation (#4826)
1 parent 2df0d23 commit daf3e37

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

+8
Original file line numberDiff line numberDiff line change
@@ -3637,6 +3637,8 @@ public <T extends JsonNode> T valueToTree(Object fromValue)
36373637
* serializable)
36383638
*
36393639
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
3640+
* It is recommended to try directly testing serialization using actual JSON inputs and outputs
3641+
* in test cases to ensure correctness and compatibility with real-world use cases.
36403642
*/
36413643
@Deprecated // @since 2.18
36423644
public boolean canSerialize(Class<?> type) {
@@ -3651,6 +3653,8 @@ public boolean canSerialize(Class<?> type) {
36513653
* @since 2.3
36523654
*
36533655
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
3656+
* It is recommended to try directly testing serialization using actual JSON inputs and outputs
3657+
* in test cases to ensure correctness and compatibility with real-world use cases.
36543658
*/
36553659
@Deprecated // @since 2.18
36563660
public boolean canSerialize(Class<?> type, AtomicReference<Throwable> cause) {
@@ -3675,6 +3679,8 @@ public boolean canSerialize(Class<?> type, AtomicReference<Throwable> cause) {
36753679
* serializable)
36763680
*
36773681
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
3682+
* It is recommended to try directly testing deserialization using actual JSON inputs and outputs
3683+
* in test cases to ensure correctness and compatibility with real-world use cases.
36783684
*/
36793685
@Deprecated // @since 2.18
36803686
public boolean canDeserialize(JavaType type)
@@ -3691,6 +3697,8 @@ public boolean canDeserialize(JavaType type)
36913697
* @since 2.3
36923698
*
36933699
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
3700+
* It is recommended to try directly testing deserialization using actual JSON inputs and outputs
3701+
* in test cases to ensure correctness and compatibility with real-world use cases.
36943702
*/
36953703
@Deprecated // @since 2.18
36963704
public boolean canDeserialize(JavaType type, AtomicReference<Throwable> cause)

src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java

+4
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,8 @@ public void acceptJsonFormatVisitor(Class<?> type, JsonFormatVisitorWrapper visi
12151215
* it could serialize an instance of given Class.
12161216
*
12171217
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
1218+
* It is recommended to try directly testing serialization using actual JSON inputs and outputs
1219+
* in test cases to ensure correctness and compatibility with real-world use cases.
12181220
*/
12191221
@Deprecated // @since 2.18
12201222
public boolean canSerialize(Class<?> type) {
@@ -1229,6 +1231,8 @@ public boolean canSerialize(Class<?> type) {
12291231
* @since 2.3
12301232
*
12311233
* @deprecated Since 2.18 use discouraged; method to be removed from Jackson 3.0
1234+
* It is recommended to try directly testing serialization using actual JSON inputs and outputs
1235+
* in test cases to ensure correctness and compatibility with real-world use cases.
12321236
*/
12331237
@Deprecated // @since 2.18
12341238
public boolean canSerialize(Class<?> type, AtomicReference<Throwable> cause) {

0 commit comments

Comments
 (0)