A data format defines how structured values are represented for transmission or storage and reconstructed later. In APIs, the format becomes the shared vocabulary between servers and clients, so its types, encodings, and edge cases must be explicit. section 5.1 section 5.4.3
Use a data format deliberately:
- Treat the format's types—not just the programming language's types—as the API contract, and document behavior for omitted or ambiguous values. section 5.1
- Standardize string content on UTF-8 unless a strong reason requires another encoding; consider Unicode normalization when exact matching matters. section 5.4.3
- Accept that serialization can lose information when languages provide different features, and preserve needed distinctions with explicit annotations. section 5.1
An ambiguous API value
If an API receives a + b, numeric values such as 2 and 4 suggest addition, while strings such as "2" and "4" suggest concatenation. Declaring the intended data types prevents clients and servers from guessing. section 5.1
Trace how formatted data moves from an API server to a client. section 5.1



