How to keep implementation and documentation in sync when using swagger 2.0 to document the REST API?

1.2k Views Asked by At

I want to use Swagger 2.0 to document REST API as this seems to be widely used to document RET APIs.

However, I am not sure how can I keep the documentation and implementation in Sync ? e.g. When I add a new API then I have to make sure that the model (to represent the Response) used in the API documentation should be same as the model created in the REST implementation. Similarly, the resource name given in the documentation should match the resource name in the implementation.

Is there a way to generate just the resource interface and model classes from the documentation produced using swagger 2.0 spec ?

1

There are 1 best solutions below

1
On

You can generate server source with these tools (they can also generate client source) :