Status
Motivation
At the moment Flink is throwing exception on unknown fields when parsing REST responses. An example for such a class is JobDetailsInfo but this applies to all others. It would be good to add this support to increase compatibility.
The real life use-case is when the Flink k8s operator wants to handle 2 jobs with 2 different Flink versions where the newer version has added a new field to any REST response.
Such case the operator has basically 2 options:
- Use the old Flink version -> Such case exception comes because new field comes but it's not expected
- Use the new Flink version -> Such case exception comes because new field is not coming but expected
To hack around this issue it requires quite some ugly code parts in the Flink k8s operator.
Proposed Changes
Ignore all unknown fields in case of REST response JSON deserialization.
Important to know that strict serialization would stay the same as-is.
Actual object mapper configuration which is intended to be changed can be found here.
Public Interfaces
Public interfaces are not going to change. The only impact that unknown properties are going to be ignored during json deserialization.
Compatibility, Deprecation, and Migration Plan
No migration is needed. When the feature is implemented all the existing features should work as before.
Test Plan
It’s planned to implement automated tests.
Rejected Alternatives
The only alternative is not to do this change and throw exception when unknown field arrives (this is the actual behavior).