GitHub user Randgalt opened a pull request:

    https://github.com/apache/curator/pull/208

    CURATOR-275 UnrecognizedPropertyException: "enabled" incompatibility

    Here is a potential fix for the issue folks. Let me know what you think...
    
    For users who don't want the new "enabled" field serialized, you can create 
a JsonInstanceSerializer in compatibility mode:
    
    ```java
    new JsonInstanceSerializer(payloadClass, true)
    ```
    
    Internally, the JsonInstanceSerializer will not serialize the enabled 
field. There are tests to ensure that this will deserialize in old clients.
    
    Going forward, JsonInstanceSerializer now sets ignore fields in the 
ObjectMapper.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-394

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/208.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #208
    
----
commit 070f1c9e4dae947ba21b015ea5027c3d20d170bd
Author: randgalt <[email protected]>
Date:   2017-03-25T00:22:48Z

    CURATOR-275 introduced a new field into ServiceInstance. This caused a 
potential UnrecognizedPropertyException in older clients that read newly 
serialized ServiceInstances. Added an alternate ctor to JsonInstanceSerializer 
with a compatibleSerializationMode option. when set to true, the new enabled 
field of ServiceInstance is not serialized.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to