In an API client, serialization converts outbound DTOs into the service’s expected payload format; deserialization maps incoming payloads into domain objects the application can use. section 8.1.7
Choose a message data model from these implementation options:
- Untyped structures such as maps or dictionaries. section 8.1.7
- Handwritten classes. section 8.1.7
- Code-generated classes. section 8.1.7
- Libraries provided by the service team. section 8.1.7
Binary payloads almost always use generated DTOs; text-based payloads also allow handwritten DTOs or untyped structures. Weigh development effort, schema correctness, type safety, and design-time coupling. section 8.1.7
Figure 8.3 An API client must have a data model of the messages that it exchanges with the service. The data model must serialize and deserialize correctly as defined by the schema. It can either be untyped (e.g. hash maps) or consist of handwritten or code-generated classes.
Compare untyped, handwritten, and generated message data models, all of which must serialize and deserialize according to the schema. section 8.1.7


























