package com.ryanpmartz.booktrackr.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class ApiDocumentationConfig {

    /**
     * Configuration for Springfox and Swagger API documentation
     *
     * @return a configured <code>Docket</code> instance to inject
     * into the Spring context
     */
    @Bean
    public Docket apiDocketConfiguration() {
        ApiInfoBuilder apiBuilder = new ApiInfoBuilder();
        apiBuilder.title("Booktrackr API Documentation");

        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiBuilder.build())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.ryanpmartz.booktrackr.controller"))
                .paths(PathSelectors.any())
                .build();
    }
}

@@ -437,16 +437,140 @@
 Docket;%0A
+import springfox.documentation.swagger.web.ApiKeyVehicle;%0Aimport springfox.documentation.swagger.web.SecurityConfiguration;%0A
 import s
@@ -1358,11 +1358,279 @@
 );%0A    %7D
+%0A%0A    @Bean%0A    SecurityConfiguration security() %7B%0A        return new SecurityConfiguration(null, null, null, null,%0A                %22JSON Web token%22,%0A                ApiKeyVehicle.HEADER,%0A                %22Authorization%22,%0A                %22,%22 /*scope separator*/);%0A    %7D
 %0A%7D%0A

add bearer token value to API config