package alien4cloud.webconfiguration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.mangofactory.swagger.configuration.SpringSwaggerConfig;
import com.mangofactory.swagger.plugin.EnableSwagger;
import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin;
import com.wordnik.swagger.model.ApiInfo;

@Configuration
@EnableSwagger
public class RestDocumentationConfig {
    private SpringSwaggerConfig springSwaggerConfig;

    @Autowired
    public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) {
        this.springSwaggerConfig = springSwaggerConfig;
    }

    @Bean
    public SwaggerSpringMvcPlugin customImplementation() {
        return new SwaggerSpringMvcPlugin(this.springSwaggerConfig).apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {
        ApiInfo apiInfo = new ApiInfo("ALIEN 4 Cloud API", "Welcome on the live configuration of ALIEN 4 Cloud Rest API.", "", "alien-support@fastconnect.fr",
                "Licensed under the Apache License, Version 2.0", "http://www.apache.org/licenses/LICENSE-2.0");
        return apiInfo;
    }
}
@@ -199,32 +199,87 @@
 n.Configuration;
+%0Aimport org.springframework.context.annotation.Profile;
 %0A%0Aimport com.man
@@ -521,16 +521,38 @@
 Swagger%0A
+@Profile(%22!noApiDoc%22)%0A
 public c

disable api doc generation with "noApiDoc" spring profile