{"url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108","forks_url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108/forks","commits_url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108/commits","id":"31112346a6c65be0e4379756d0652108","node_id":"MDQ6R2lzdDMxMTEyMzQ2YTZjNjViZTBlNDM3OTc1NmQwNjUyMTA4","git_pull_url":"https://gist.github.com/31112346a6c65be0e4379756d0652108.git","git_push_url":"https://gist.github.com/31112346a6c65be0e4379756d0652108.git","html_url":"https://gist.github.com/michaellihs/31112346a6c65be0e4379756d0652108","files":{"swagger-cheatsheet.md":{"filename":"swagger-cheatsheet.md","type":"text/markdown","language":"Markdown","raw_url":"https://gist.githubusercontent.com/michaellihs/31112346a6c65be0e4379756d0652108/raw/446cd4ca5e5516ebb37fd9f3b91b0db5e31840f7/swagger-cheatsheet.md","size":1078,"truncated":false,"content":"Swagger and Spring\n==================\n\nAdd the following dependencies to your `pom.xml`\n\n````xml\n<dependency>\n    <groupId>io.springfox</groupId>\n    <artifactId>springfox-swagger-ui</artifactId>\n    <version>2.5.0</version>\n    <scope>compile</scope>\n</dependency>\n\n<dependency>\n    <groupId>io.springfox</groupId>\n    <artifactId>springfox-swagger2</artifactId>\n    <version>2.5.0</version>\n    <scope>compile</scope>\n</dependency>\n````\n\nAdd the following `@Configuration` class\n\n````java\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n\n\t@Bean\n\tpublic Docket api(){\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.select()\n\t\t\t\t.apis(RequestHandlerSelectors.any())\n\t\t\t\t.paths(PathSelectors.any())\n\t\t\t\t.build()\n\t\t\t\t.apiInfo(apiInfo());\n\t}\n\n\t\tprivate ApiInfo apiInfo() {\n\t\t\treturn new ApiInfoBuilder()\n\t\t\t\t\t.title(\"API Title\")\n\t\t\t\t\t.description(\"Description of API Documentation\")\n\t\t\t\t\t.version(\"0.0.1\")\n\t\t\t\t\t.build();\n\t\t}\n\n}\n```` \n\nFurther References\n==================\n\n* [Swagger integration in Spring](https://springfox.github.io/springfox/docs/current)\n* ","encoding":"utf-8"}},"public":true,"created_at":"2016-09-02T13:49:06Z","updated_at":"2021-01-23T00:38:05Z","description":"Swagger Cheatsheet","comments":0,"user":null,"comments_enabled":true,"comments_url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108/comments","owner":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"forks":[],"history":[{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"9a1a946eaf6d0b95ad947ebf5a70de7b2930adbe","committed_at":"2016-09-02T13:51:12Z","change_status":{"total":45,"additions":44,"deletions":1},"url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108/9a1a946eaf6d0b95ad947ebf5a70de7b2930adbe"},{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"288e94a6d277d7ebcbe7c0e1a346f5a462383106","committed_at":"2016-09-02T13:49:06Z","change_status":{"total":11,"additions":11,"deletions":0},"url":"https://api.github.com/gists/31112346a6c65be0e4379756d0652108/288e94a6d277d7ebcbe7c0e1a346f5a462383106"}],"truncated":false}