If you use Maven, you can generate documentation on the client side and on the server (yaml, json and html) using swagger-maven-plugin
Add this to your pom.xml:
..... <plugin> <groupId>com.github.kongchen</groupId> <artifactId>swagger-maven-plugin</artifactId> <version>3.0.1</version> <configuration> <apiSources> <apiSource> <springmvc>true</springmvc> <locations>com.yourcontrollers.package.v1</locations> <schemes>http,https</schemes> <host>localhost:8080</host> <basePath>/api-doc</basePath> <info> <title>Your API name</title> <version>v1</version> <description> description of your API</description> <termsOfService> http://www.yourterms.com </termsOfService> <contact> <email>your-email@email.com</email> <name>Your Name</name> <url>http://www.contact-url.com</url> </contact> <license> <url>http://www.licence-url.com</url> <name>Commercial</name> </license> </info> <templatePath>${basedir}/templates/strapdown.html.hbs</templatePath> <outputPath>${basedir}/generated/document.html</outputPath> <swaggerDirectory>generated/swagger-ui</swaggerDirectory> <securityDefinitions> <securityDefinition> <name>basicAuth</name> <type>basic</type> </securityDefinition> </securityDefinitions> </apiSource> </apiSources> </configuration> </plugin> ........
You can download the * .hbs template at this address: https://github.com/kongchen/swagger-maven-example
Run mvn swagger: generate the JSon documentation that will be generated in your / genaged / swagger / directory. Go to this address: http://editor.swagger.io
And generate what you want (server side or client side API in your preferred technology)
Mk-rou
source share