response model

A type, often a record, that describes exactly the data an API accepts or returns, separate from database entities.

In more detail

Keeping wire models separate from persistence entities lets each change for its own reasons and stops internal fields leaking to clients. The service translates entities into response models before the controller returns them.

Example

record OrderView(String id, String status) { }

Related terms

Taught in

References