package reciter.swagger;

import static springfox.documentation.builders.PathSelectors.regex;

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.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfig {
    @Bean
    public Docket productApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.basePackage("reciter.controller"))
                .paths(regex("/reciter.*"))
                .build()
                .apiInfo(apiInfo());
//                .securitySchemes(Arrays.asList(apiKey()));
    }
    
   private ApiInfo apiInfo() {
       return new ApiInfoBuilder().title("ReCiter API")
               .description("The REST API for ReCiter.").termsOfServiceUrl("")
               .contact(new Contact("Sarbajit Dutta", "https://github.com/wcmc-its/ReCiter", "szd2013@med.cornell.edu"))
               .contact(new Contact("Paul J. Albert", "https://github.com/wcmc-its/ReCiter", "paa2013@med.cornell.edu"))
               .license("Apache License Version 2.0")
               .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")
               .version("2.0.0")
               .build();
   }

   /*
   private ApiKey apiKey() {
       return new ApiKey("reciter", "reciter", "header");
   }
   */
}

@@ -1040,19 +1040,45 @@
 ReCiter 
-API
+publication management system
 %22)%0A     
@@ -1105,33 +1105,245 @@
 on(%22
-The REST API for 
+Populate and retrieve identity data for a scholar. Trigger publication lookups and scoring for a scholar. Retrieve publications for a scholar. Interact with ReCiter Publication Manager. More info here: http://github.com/wcmc-its/
 ReCiter
-.
+/
 %22).t
@@ -1404,22 +1404,22 @@
 ct(%22
-Sarbajit Dutta
+Paul J. Albert
 %22, %22
@@ -1461,11 +1461,11 @@
 %22, %22
-szd
+paa
 2013
@@ -1517,38 +1517,38 @@
 ew Contact(%22
-Paul J. Albert
+Sarbajit Dutta
 %22, %22https://
@@ -1570,35 +1570,35 @@
 -its/ReCiter%22, %22
-paa
+szd
 2013@med.cornell

add swagger title and description