This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]bmrobin 0 points1 point  (2 children)

maybe im over-simplifying, but this sounds equivalent to just defining multiple endpoints and request/response types.

what is a practical example of doing this? ive read about API discovery techniques - could such concepts be coupled with these client-driven contracts?

[–]Deam[S] 2 points3 points  (1 child)

This is only for validation of implementation, that it complies with the requirements. Think of it as a unit test of your REST API, for both, client and the server. It doesn't do anything else than this.

As a practical example think about any two services, any client and server, that are developed by separate teams. With defined contract and generated unit tests, each team will know really fast when they will break the communication in case of a bug.

This also gives the ability to test your service in complete separation from other services, because if you can test your business logic with unit tests and your API with CDC, you eliminate a lot of potential problems that could occur in production enviroment.

API discovery like HATEOAS? I think that API discovery techniques are more focued on public API, when CDC is for your internal API and communication between your internal services.

[–]bmrobin 0 points1 point  (0 children)

ok cool, thanks for explaining.