Prototyping in API design is a preparation phase for productive implementation. One goal of prototyping is to learn as many practical insights as possible while spending as little effort as possible. This can be achieved by quickly creating a simple prototype implementation, that you plan to throw away .
During the prototyping phase, the critical aspects of the API are assessed. Assessment of the prototype is performed from a technical perspective by the engineers and from a usability perspective by pilot consumers. Typical design decisions that are explored during prototyping are the backend design decisions and the non-functional properties of the system.
The API prototype should conform to the API description and use real data from real backends. To achieve the necessary speed, the implementation does not have to be pretty, does not have to be optimized, and may contain engineering shortcuts. Code generation can be used to fulfill both goals of practical insights and low effort for the creation of the prototype. Properly generated code conforms to the API description. However, the generated code is merely the “bones” of a skeleton, only the interface of the API can be generated. The missing code can be added with relatively low effort since the skeleton already provides a structure .
When designing APIs for microservices, it is important to keep in mind that all data exchange between services happens either through messages or API calls. APIs must be efficient to avoid creating chatty I/O. Because services are designed by teams working independently, APIs must have well-defined semantics and versioning schemes, so that updates don't break other services .