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
An annotation that automatically makes the tracking of "modified fields" possible.
A "modified field" is a field of which the setter-function has been called at least once in the lifetime of the object-instance.
Given that Pojos are often created during Deserialization (given data from a (rest)-endpoint, or from an import-file) / when external systems call the java-backend (for example with a REST-PATCH method call).
To support REST-PATCH it is necessary to be able to detected which of the incoming data-fields have really been given by the caller to decide (via openapi definition) if those fields are required=true/false. If they are not not required they may also be missing from the request, but if they are required, they must either provide a value or NULL as a value (which is also a valid value)
The modified-fields would help to be able to check in the code if a field has been set by the caller. For example
if (pojo.getModifiedFields().contains("test") {
update.set("test", pojo.getTest());
}
Describe the target audience
Java Programmers wanting to implement REST PATCH Api (PATCH needs the ability of modified fields tracking)
Java Programmers wanting to create dynamic imports that only process data from fields in import-files (JSON, XML, ...) that have really been given
Additional context
An annotation on the class-level would be helpful. For example:
@SettersWithTracking
MyPojo {
...
}
If an interest is there to implement this feature, i would also think about helping implementing it in lombok / discussing it further (this is only a very raw concept)
The text was updated successfully, but these errors were encountered:
Describe the feature
An annotation that automatically makes the tracking of "modified fields" possible.
A "modified field" is a field of which the setter-function has been called at least once in the lifetime of the object-instance.
Given that Pojos are often created during Deserialization (given data from a (rest)-endpoint, or from an import-file) / when external systems call the java-backend (for example with a REST-PATCH method call).
To support REST-PATCH it is necessary to be able to detected which of the incoming data-fields have really been given by the caller to decide (via openapi definition) if those fields are required=true/false. If they are not not required they may also be missing from the request, but if they are required, they must either provide a value or NULL as a value (which is also a valid value)
The modified-fields would help to be able to check in the code if a field has been set by the caller. For example
Describe the target audience
Additional context
An annotation on the class-level would be helpful. For example:
If an interest is there to implement this feature, i would also think about helping implementing it in lombok / discussing it further (this is only a very raw concept)
The text was updated successfully, but these errors were encountered: