bond

Are Bond field names used in deserialization?


Suppose I serialized a given Bond struct with a single field:

struct NameBond
{
    1: string name;
}

And then I renamed the field in the .bond file (without changing its ordinal):

struct NameBond
{
    1: string displayName;
}

Would I still be able to deserialize it?

What about the name of the struct? (NameBond in the example.)

Would changing that prevent me from deserializing?


Solution

  • This depends on which protocol you are using.

    You may want to consult the Bond schema evolution guide, where it says:

    Caution should be used when changing or reusing field names as this could break text-based protocols like SimpleJsonProtocol

    See also this related SO question.