API contracts
An API contract is the definition of a web API. Like any standard API, a consumer should know how to call an endpoint and what to expect from it in return. Each endpoint should have a signature, like a method, and should enforce that signature.
Using DTOs as input and output makes them part of that contract, adding even more value to them, locking in place the contract instead of using a more volatile model, shared across multiple parts of the system. From this point forward, a DTO is more than a simple "object used to transfer data." It becomes an integral part of the contract, and the only reason for a DTO to change is directly linked to that contract.
Now that we have an idea of an API contract, let's see how to share those contracts that define our APIs. For teamwork, communication is the key, and the same goes for system collaboration. So, consumers of an API should have access to the contracts to consume the exposed resources more efficiently...