All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.fraunhofer.iese.ind2uce.swagger.SwaggerDetailConfiguration Maven / Gradle / Ivy

Go to download

IND2UCE :: Webproject related contents like JSON, Autoconfiguration of Spring, etc.

There is a newer version: 3.2.69
Show newest version
/*-
 * =================================LICENSE_START=================================
 * IND2UCE
 * %%
 * Copyright (C) 2017 Fraunhofer IESE (www.iese.fraunhofer.de)
 * %%
 * The Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Hansastrasse 27c, 80686 Munich, Germany (further: Fraunhofer) is holder of all proprietary rights on this computer program.
 * You can only use this computer program if you have closed a license agreement with Fraunhofer or you get the right to use the computer program from someone who is authorized to grant you that right.
 * Any use of the computer program without a valid license is prohibited and liable to prosecution.
 *
 * Copyright (C) 2018 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. acting on behalf of its Fraunhofer Institute for Experimental Software Engineering (IESE)
 *
 * All rights reserved.
 *
 * Contact: [email protected]
 * =================================LICENSE_END=================================
 */

package de.fraunhofer.iese.ind2uce.swagger;

import de.fraunhofer.iese.ind2uce.api.common.Ind2uceEntity;

import com.google.common.base.Predicates;

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

import java.util.Collections;

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;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
@Profile("default")
public class SwaggerDetailConfiguration {
  /**
   * Swagger spring mvc plugin.
   *
   * @return the docket
   */
  @Bean
  public Docket swaggerSpringMvcPlugin() {
    return new Docket(DocumentationType.SWAGGER_2).apiInfo(this.apiInfo()).groupName("api-ind2uce").select().apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot")))
        .build();
  }

  /**
   * Swagger Api info.
   *
   * @return the api info used by springfox swagger
   */
  protected ApiInfo apiInfo() {
    return new ApiInfo("API Documentation", "This site provides REST API documentation for IND2UCE web services. ", Ind2uceEntity.class.getPackage().getImplementationVersion(),
        "http://www.iese.fraunhofer.de/content/dam/iese/de/dokumente/Terms_and_Conditions_on_Licensing_Software_for_Permanent_and_Gratuitously_Use.pdf",
        new Contact("Fraunhofer IESE", "http://ind2uce.iese.fraunhofer.de", "[email protected]"), "IESE Licence",
        "http://www.iese.fraunhofer.de/content/dam/iese/de/dokumente/Terms_and_Conditions_on_Licensing_Software_for_Permanent_and_Gratuitously_Use.pdf", Collections.emptyList());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy