{"id":18991280,"url":"https://github.com/jarlehansen/springfox-loader","last_synced_at":"2025-10-12T06:35:10.221Z","repository":{"id":94603472,"uuid":"61183047","full_name":"jarlehansen/springfox-loader","owner":"jarlehansen","description":"Simplifies the setup of Springfox.","archived":false,"fork":false,"pushed_at":"2018-12-19T20:27:38.000Z","size":155,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T00:17:33.376Z","etag":null,"topics":["springfox","springfox-loader","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jarlehansen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-06-15T06:28:47.000Z","updated_at":"2019-01-05T21:00:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"16059eb3-ffa0-4a0d-8856-5ea10eb8c6aa","html_url":"https://github.com/jarlehansen/springfox-loader","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarlehansen%2Fspringfox-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarlehansen%2Fspringfox-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarlehansen%2Fspringfox-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarlehansen%2Fspringfox-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jarlehansen","download_url":"https://codeload.github.com/jarlehansen/springfox-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250234863,"owners_count":21397091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["springfox","springfox-loader","swagger","swagger-ui"],"created_at":"2024-11-08T17:13:24.278Z","updated_at":"2025-10-12T06:35:05.195Z","avatar_url":"https://github.com/jarlehansen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Springfox Loader\n\n[![Build Status](https://travis-ci.org/jarlehansen/springfox-loader.svg?branch=master)](https://travis-ci.org/jarlehansen/springfox-loader)\n[![Coverage Status](https://coveralls.io/repos/github/jarlehansen/springfox-loader/badge.svg?branch=master)](https://coveralls.io/github/jarlehansen/springfox-loader?branch=master)\n\nSimplifies the initialization of [Springfox](http://springfox.io/).\nIt does not offer all the flexibility and configuration options available in Springfox, but is created to be a simple way to\nget spring + swagger up and running without the need for a lot of configuration.\n\n__Features:__\n* Annotation-based configuration\n* Support for standard Spring application-configuration in properties/yml files\n* Support for using Spring placeholder values `${...}`  in the configuration\n* Easy to extend by using the standard Springfox classes\n* Convention based naming of values displayed in swagger-ui, minimizing the need for manual configuration\n\n---\n\n* [Installation](#installation)\n * [Gradle](#gradle)\n * [Maven](#maven)\n* [Usage](#usage)\n * [Properties](#properties)\n * [Swagger UI](#swagger-ui)\n * [Custom options](#custom-options)\n * [References](#references)\n\n## Installation\n\nThe required springfox dependencies are included when you add the _Springfox Loader_ dependency.\n\nThe jar-file available in [JCenter](https://bintray.com/jarlehansen/maven/springfox-loader/).\n\n### Gradle\n\n_build.gradle_\n```groovy\ncompile('com.github.springfox.loader:springfox-loader:2.0.0')\n```\n\n### Maven\n\n_pom.xml_\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.springfox.loader\u003c/groupId\u003e\n    \u003cartifactId\u003espringfox-loader\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nAdd `@EnableSpringfox` to the class containing the Spring boot main method (`@SpringBootApplication`).\nThis will automatically create the springfox configuration for you.\n\nThe required values in the `@EnableSpringfox` is title and version. You can set these values either by using `@Info` or\nwith the properties _springfox.title_ and _springfox.version_.\n\nIt is also possible to add Spring placeholders (with the `${...}` syntax) as values in the annotation.\nThis can be useful if you want to add values that are defined in for example properties/yml files.\nIn the example below the value `${version}` can be added in for example the application.properties-file\n\n __Minimal examples__\n ```java\n@EnableSpringfox(\n        @Info(title = \"title\", version = \"${version}\")\n)\n ```\n\n_or add configuration properties_\n```\nspringfox.title=my-app\nspringfox.version=1.0.0\n```\n\n```java\n@EnableSpringfox\n```\n\n\n__Full example__\n```java\n@EnableSpringfox(\n    convention = false,\n    swaggerUiBasePath = \"\",\n    includeControllers = MyController.class,    \n    value = @Info(\n         title = \"\",\n         version = \"\",\n         description = \"\",\n         termsOfService = \"\",\n         contact = @Contact(name = \"\", url = \"\", email = \"\"),\n         license = @License(name = \"\", url = \"\"),\n         extensions = @Extension(name = \"x-test\",\n            properties = @ExtensionProperty(name = \"test-key\", value = \"test-value\")\n         ))\n)\n```\n\n* Use __convention__ to print better names on the swagger-ui page. It will split the operation name by\nreplacing camelcase with space and uppercasing the word (for example the method `getCustomer()` will be displayed as `Get customer`).\nIf the `@ApiOperation` annotation is present, these values will be used.\n* __swaggerUiBasePath__ customize the base path to swagger-ui. If the value is for example '/documentation', the path to swagger-ui will be '/documentation/swagger-ui.html'.\n* __includeControllers__ add controllers to the swagger configuration that is not registered in the default base package (which is based on the Application class).\n\n### Properties\n\nIt is also possible to configure the values using properties/yml files (typically _application.properties_ / _application.yml_).\nOn startup it will try to lookup the same configuration options as described above with 'springfox.' as a prefix.\nFor example springfox.path.\n\nIf both the annotation values and properties values are defined the values from the properties/yml-file is used.\n\n__Application properties__\n* springfox.path\n* springfox.title _or_ spring.application.name\n* springfox.description\n* springfox.version\n* springfox.terms-of-service-url\n* springfox.contact.name\n* springfox.contact.url\n* springfox.contact.email\n* springfox.license.name\n* springfox.license.url\n* springfox.profiles - _Enable springfox for the configured profiles. If not set, all profiles loads springfox. Default is all profiles._\n* springfox.swagger-ui-base-path\n\n### Swagger UI\n\nThe swagger-ui dependency is already included by Springfox Loader.\nAfter enabling Springfox Loader you can access the webpage: `http://localhost:8080/swagger-ui.html`  \nThe base path to swagger-ui can be customized with the `springfox.swagger-ui-base-path`.\n\nA list of the swagger resources are available here: http://localhost:8080/swagger-resources\n\n### Custom options\nIf there are options that are available in Springfox, but not the Springfox-loader it is possible to add it manually.\nYou can simply autowire the [Docket-object](http://springfox.github.io/springfox/javadoc/current/springfox/documentation/spring/web/plugins/Docket.html) and can alter the setup as needed.\n\n```java\n@Autowired\nprivate Docket docket;\n\n@PostConstruct\npublic void init() {\n    docket.apiInfo(new ApiInfo(\"My new title\", \"\", \"1.0.0\", \"\", new Contact(\"\", \"\", \"\"), \"\", \"\"));\n}\n```\n\n### References\n* [Springfox Reference Documentation](http://springfox.github.io/springfox/docs/current/)\n* [Swagger Core Annotations](https://github.com/swagger-api/swagger-core/wiki/Annotations-1.5.X)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarlehansen%2Fspringfox-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjarlehansen%2Fspringfox-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarlehansen%2Fspringfox-loader/lists"}