You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note** that if DTO used in the endpoint is **mutable** (e.g. has setters for all attributes), then an existing method from the Jackson library can be used instead of the `ObjectPatcher`:
60
+
**Note** that if DTO used in the endpoint is **mutable** (e.g. has setters for all attributes), then an existing method from the Jackson library can be used instead of the `ObjectPatcher` to patch the source object in-place:
Therefore, it is required to validate patched object in the endpoint code. Unfortunately, Spring doesn't provide one-liner API to perform such validation. As a shortcut to perform the validation, `ObjectPatcher` provides several methods:
76
81
77
82
```java
83
+
importio.amplicode.rautils.patch.ObjectPatcher;
84
+
78
85
@Autowired
79
-
privateObjectMapper objectMapper;
86
+
privateObjectPatcher objectPatcher;
80
87
81
88
// just validate
82
89
// public void ObjectPatcher#validate(Object target);
0 commit comments