Story #06 API Conformance · JSON Interoperability

The Mobile App Failure

"JSON property order isn't guaranteed. Millions of users learned that lesson at login"

A mobile banking app's deserialization library relied on a fixed property order in authentication responses. When the backend upgraded its framework, the property order changed. Millions of users experienced login failures immediately after the release.

What happened

Harborstone Bank’s mobile applications consumed an authentication API that returned an access token, token type, expiration, and session metadata. The response was valid JSON, the data was correct—but the mobile client’s deserialization library had an undocumented dependency: it used field position rather than field name to extract values.

This worked for years because the backend framework happened to serialize fields in a consistent order. When the authentication team upgraded to a newer framework with different serialization behavior, the property order changed. The mobile app suddenly read the token type value from what was now the expiration field, and vice versa.

The app passed its integration tests—those tests used the new framework too, so the order was consistent. But millions of active users running production builds against the old response format experienced login failures immediately.

Root cause

JSON has no guaranteed property order. The dependency on order was never documented and never tested. No contract test compared the actual response structure against what the client’s deserialization code actually required.

The fix

The team rolled back the framework upgrade while the mobile app was patched to use named field access. Conformance tests were added that serialized the authentication response through multiple JSON libraries and verified the client could deserialize all of them correctly.

Lesson learned

Implicit assumptions about response structure—field order, whitespace, casing—are invisible until they break. Contract testing must validate what consumers actually parse, not just whether the data is logically correct.

The Mobile App Failure