Driftwatch

Square / Square API /

Breakingdirection flip: their tools call this safe

value can now return "CARNET", "ID", "QUICPAY", "TRANSPORTATION_IC"

What changed

Producer-side tools call this additive. It breaks exhaustive switches, strict parsers and generated client enums.

Affects this value on CardBrand reachable from 30 operations.

New values: CARNET, ID, QUICPAY, TRANSPORTATION_IC.

can now return "CARNET", "ID", "QUICPAY", "TRANSPORTATION_IC"

Who is affected

Code that reads Square's CardBrand objects, used by 30 Square operations.

Before and after

WhereBeforeAfter
CardBrand"AMERICAN_EXPRESS", "CHINA_UNIONPAY", "DISCOVER", "DISCOVER_DINERS", "EBT", "EFTPOS", "FELICA", "INTERAC", "JCB", "MASTERCARD", "OTHER_BRAND", "SQUARE_CAPITAL_CARD", "SQUARE_GIFT_CARD", "VISA""AMERICAN_EXPRESS", "CARNET", "CHINA_UNIONPAY", "DISCOVER", "DISCOVER_DINERS", "EBT", "EFTPOS", "FELICA", "ID", "INTERAC", "JCB", "MASTERCARD", "OTHER_BRAND", "QUICPAY", "SQUARE_CAPITAL_CARD", "SQUARE_GIFT_CARD", "TRANSPORTATION_IC", "VISA"

Code that breaks

switch (response) {
  // existing branches …
  // no branch for "CARNET"
  // no branch for "ID"
  // no branch for "QUICPAY"
  // no branch for "TRANSPORTATION_IC"
  default:
    throw new Error("unexpected value");
}

Based on Square’s published API specification. How severity is decided.