2

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?

chwarr
  • 6,777
  • 1
  • 30
  • 57
yuvalm2
  • 866
  • 2
  • 10
  • 27

1 Answers1

2

This depends on which protocol you are using.

  • Your change will cause no problems in the CompactBinary serializer.
  • It may cause trouble with other protocols.

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.

Community
  • 1
  • 1
Anton Schwaighofer
  • 3,119
  • 11
  • 24