Grokking Modern API Design Interview
Vote
0% completed
Field Types That Break Contracts
Two services calculate the same invoice from {"unit_price": 19.99, "quantity": 3}. Each one reads and rounds that number through a different language and library. One stores 5997 cents. The other one lands just past a rounding boundary and rounds the other way. The customer sees a one-cent disagreement.
The API looked simple. The field type made the disagreement possible.
Most contract mistakes can be repaired by adding an optional field. Type mistakes cannot, because callers copy your values into databases, spreadsheets, caches, generated classes, and billing systems
.....
.....
.....
Like the course? Get enrolled and start learning!