springfox.documentation.service.Tag Java Examples

The following examples show how to use springfox.documentation.service.Tag. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringfoxConfig.java    From AuTe-Framework with Apache License 2.0 6 votes vote down vote up
@Bean
Docket api(ApiInfo apiInfo) {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo)
            .protocols(Collections.singleton("http"))
            .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.ant("/rest/**"))
                .build()
            .useDefaultResponseMessages(false)
            .tags(
                    new Tag(TAG_EXECUTION, "Executing auto-tests"),
                    new Tag(TAG_PROJECT, "Operations with projects and scenario groups"),
                    new Tag(TAG_SCENARIO, "Operations with scenarios and its steps"),
                    new Tag(TAG_STEP, "Operations with steps"),
                    new Tag(TAG_VERSION, "Components versions")
            );
}
 
Example #2
Source File: TestDriveSwaggerConfiguration.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@Bean
public Docket testdriveSwagger() {
  return new Docket(SWAGGER_2)
      .groupName("testdrive")
      .apiInfo(new ApiInfoBuilder().title("Test Drive").build())
      .useDefaultResponseMessages(false)
      .tags(new Tag("testdrive", "Test Drive"))
      .select()
      .paths(PathSelectors.regex("/testdrive.*"))
      .build();
}
 
Example #3
Source File: OnrampSwaggerConfiguration.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@Bean
public Docket onrampSwagger() {
  return new Docket(SWAGGER_2)
      .groupName("onramp")
      .securitySchemes(Collections.singletonList(new BasicAuth(BASIC_AUTH)))
      .securityContexts(Collections.singletonList(securityContext()))
      .apiInfo(new ApiInfoBuilder().title("Onramp").build())
      .useDefaultResponseMessages(false)
      .tags(new Tag("onramp", "Submit messages"))
      .select()
      .apis(RequestHandlerSelectors.any())
      .paths(PathSelectors.regex("/onramp.*"))
      .build();
}
 
Example #4
Source File: PaverSwaggerConfiguration.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@Bean
public Docket paverSwagger() {
  return new Docket(SWAGGER_2)
      .groupName("paver")
      .securitySchemes(Collections.singletonList(new BasicAuth(BASIC_AUTH)))
      .securityContexts(Collections.singletonList(securityContext()))
      .apiInfo(new ApiInfoBuilder().title("Paver").build())
      .useDefaultResponseMessages(false)
      .tags(new Tag("road", "Administer roads"), new Tag("schema", "Administer schemas"))
      .select()
      .apis(RequestHandlerSelectors.any())
      .paths(PathSelectors.regex("/paver.*"))
      .build();
}
 
Example #5
Source File: SwaggerConfig.java    From spring-boot-jwt with MIT License 5 votes vote down vote up
@Bean
public Docket api() {
  return new Docket(DocumentationType.SWAGGER_2)//
      .select()//
      .apis(RequestHandlerSelectors.any())//
      .paths(Predicates.not(PathSelectors.regex("/error")))//
      .build()//
      .apiInfo(metadata())//
      .useDefaultResponseMessages(false)//
      .securitySchemes(new ArrayList<>(Arrays.asList(new ApiKey("Bearer %token", "Authorization", "Header"))))//
      .tags(new Tag("users", "Operations about users"))//
      .tags(new Tag("ping", "Just a ping"))//
      .genericModelSubstitutes(Optional.class);

}
 
Example #6
Source File: DocAutoConfiguration.java    From dew with Apache License 2.0 5 votes vote down vote up
/**
 * Rest api docket.
 *
 * @param servletContext the servlet context
 * @return the docket
 */
@Bean
public Docket restApi(ServletContext servletContext) {
    return new Docket(DocumentationType.SWAGGER_2)
            .tags(new Tag(FLAG_APPLICATION_NAME, Dew.Info.name))
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(dewConfig.getBasic().getDoc().getBasePackage()))
            .paths(PathSelectors.any())
            .build()
            /*.securitySchemes(new ArrayList<ApiKey>() {{
                add(new ApiKey("access_token", "accessToken", "develop"));
            }})
            .globalOperationParameters(new ArrayList<Parameter>() {{
                add(new ParameterBuilder()
                        .name(Dew.dewConfig.getSecurity().getTokenFlag())
                        .description("token 用于鉴权,部分接口必须传入")
                        .modelRef(new ModelRef("String"))
                        .parameterType(Dew.dewConfig.getSecurity().isTokenInHeader() ? "header" : "query")
                        .hidden(false)
                        .required(true)
                        .build());
            }})*/
            .pathProvider(new RelativePathProvider(servletContext) {
                @Override
                public String getApplicationBasePath() {
                    return contextPath + super.getApplicationBasePath();
                }
            });
}
 
Example #7
Source File: SpringfoxConfiguration.java    From code-examples with MIT License 4 votes vote down vote up
@Bean
public Docket docket() {
    return new Docket(DocumentationType.SWAGGER_2)
            .tags(new Tag("Address Entity", "Repository for Address entities"))
            .apiInfo(new ApiInfo("Customer Service API", "REST API of the Customer Service", "v42", null, null, null, null, Lists.newArrayList()));
}