package org.devgateway.toolkit.web.spring;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static springfox.documentation.builders.PathSelectors.regex;

@Configuration
@EnableSwagger2
public class SwaggerConfig {
	@Bean
	public Docket ocDashboardsApi() {
		return new Docket(DocumentationType.SWAGGER_2).groupName("ocDashboardsApi").apiInfo(ocDashboardsApiInfo())
				.select().apis(RequestHandlerSelectors.any()).paths(regex("/api/.*")).build();
	}

	@Bean
	public Docket manageApi() {
		return new Docket(DocumentationType.SWAGGER_2).groupName("manageApi")
				.select().apis(RequestHandlerSelectors.any()).paths(regex("/manage/.*")).build();
	}

	private ApiInfo ocDashboardsApiInfo() {
		return new ApiInfoBuilder().title("Open Contracting Dashboards API")
				.description("These endpoints are used to feed the open contracting dashboard").license("MIT")
				.licenseUrl("https://opensource.org/licenses/MIT").version("1.0").build();
	}

}
@@ -731,16 +731,17 @@
 upName(%22
+1
 ocDashbo
@@ -964,16 +964,17 @@
 upName(%22
+2
 manageAp
@@ -1275,16 +1275,24 @@
 nse(%22MIT
+ License
 %22)%0A%09%09%09%09.

update license and ordering of groups of endpoints