Skip to content

You should not insert new entries in the middle of enumerations? #22

@kendallb

Description

@kendallb

Ok, anyone who uses these API definitions to generate API code in strongly typed languages like C# or Java will end up with an enumeration for the 'error_code' field. We had a breakage yesterday when some of the carriers started returning new error values that were not defined in the spec so the resulting payload would fail to parse.

We reached out to support and the 'fix' is this commit:

e3e74cb

Which just adds the new errors to the enumeration. But that does not help anyone who has pre-compiled libraries as we all need to rebuild against the new spec. But worse, since you just inserted new values into the error table in the middle of the table, any existing binary values that represent those values when generated by an API will no longer be compatible.

Honestly it's just not a good idea to add new fields to enumerations as defined in the spec as you will break folks code running out in the wild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions