springfox.documentation.spi.DocumentationType配置示例

Java Code Examples for springfox.documentation.spi.DocumentationType

The following are top voted examples for showing how to use springfox.documentation.spi.DocumentationType. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to product more good examples. 

Example 1
Project: Learny---Server   File: SwaggerConfig.java View source code6 votesvote downvote up
@Beanpublic Docket learnyApi() {return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)).paths(PathSelectors.any()).build().pathMapping("/").directModelSubstitute(LocalDate.class,String.class).genericModelSubstitutes(ResponseEntity.class).useDefaultResponseMessages(false).securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));}
Example 2
Project: jhipster_myapp   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket swaggerSpringMvcPlugin = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)) // and by paths.build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return swaggerSpringMvcPlugin;}
Example 3
Project: jhipster-sample-app-gradle   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();ApiInfo apiInfo = new ApiInfo(
        jHipsterProperties.getSwagger().getTitle(),
        jHipsterProperties.getSwagger().getDescription(),
        jHipsterProperties.getSwagger().getVersion(),
        jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
        jHipsterProperties.getSwagger().getContact(),
        jHipsterProperties.getSwagger().getLicense(),
        jHipsterProperties.getSwagger().getLicenseUrl());Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 4
Project: menuber   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 5
Project: jhipster-sample-app-java7   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();ApiInfo apiInfo = new ApiInfo(
        jHipsterProperties.getSwagger().getTitle(),
        jHipsterProperties.getSwagger().getDescription(),
        jHipsterProperties.getSwagger().getVersion(),
        jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
        jHipsterProperties.getSwagger().getContact(),
        jHipsterProperties.getSwagger().getLicense(),
        jHipsterProperties.getSwagger().getLicenseUrl());Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 6
Project: bugkillers   File: SpringfoxConfig2.java View source code6 votesvote downvote up
@Beanpublic Docket swaggerSpringMvcPlugin() {//        return new Docket(DocumentationType.SWAGGER_2);return new Docket(DocumentationType.SWAGGER_2)//                .groupName("bugkillers").select()//Ignores controllers annotated with @CustomIgnore//                .apis(not(withClassAnnotation(CustomIgnore.class)) //Selection by RequestHandler.paths(paths()) // and by paths.build().apiInfo(apiInfo()).securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));}
Example 7
Project: springfox-demos   File: Application.java View source code6 votesvote downvote up
@Beanpublic Docket petApi() {return new Docket(DocumentationType.SWAGGER_2).groupName("full-petstore-api").apiInfo(apiInfo()).select().paths(petstorePaths()).build();}
Example 8
Project: flipper-reverse-image-search   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 9
Project: jhipster-ionic   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 10
Project: barweb   File: ApiDocumentationConfig.java View source code6 votesvote downvote up
@Beanpublic Docket petApi() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().pathMapping("/api").directModelSubstitute(LocalDate.class, String.class).genericModelSubstitutes(ResponseEntity.class).alternateTypeRules(newRule(
                    typeResolver.resolve(DeferredResult.class,
                            typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
                    typeResolver.resolve(WildcardType.class))).useDefaultResponseMessages(false).globalResponseMessage(RequestMethod.GET, newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build())).securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));}
Example 11
Project: jhipster-sample-app   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();ApiInfo apiInfo = new ApiInfo(
        jHipsterProperties.getSwagger().getTitle(),
        jHipsterProperties.getSwagger().getDescription(),
        jHipsterProperties.getSwagger().getVersion(),
        jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
        jHipsterProperties.getSwagger().getContact(),
        jHipsterProperties.getSwagger().getLicense(),
        jHipsterProperties.getSwagger().getLicenseUrl());Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 12
Project: availability   File: SwaggerConfig.java View source code6 votesvote downvote up
@Beanpublic Docket api() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().pathMapping("/").directModelSubstitute(LocalDate.class,String.class).genericModelSubstitutes(ResponseEntity.class).alternateTypeRules(
          newRule(typeResolver.resolve(DeferredResult.class,
                  typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
              typeResolver.resolve(WildcardType.class))).useDefaultResponseMessages(false).globalResponseMessage(RequestMethod.GET,
          newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build())).securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext())).enableUrlTemplating(true);}
Example 13
Project: jhipster-sample-app-mongodb   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();ApiInfo apiInfo = new ApiInfo(
        jHipsterProperties.getSwagger().getTitle(),
        jHipsterProperties.getSwagger().getDescription(),
        jHipsterProperties.getSwagger().getVersion(),
        jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
        jHipsterProperties.getSwagger().getContact(),
        jHipsterProperties.getSwagger().getLicense(),
        jHipsterProperties.getSwagger().getLicenseUrl());Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 14
Project: spring-swagger2markup-demo   File: SwaggerConfig.java View source code6 votesvote downvote up
@Beanpublic Docket restApi() {return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().paths(Predicates.and(ant("/**"), Predicates.not(ant("/error")))).build();}
Example 15
Project: cqrs-axon   File: Swagger2Configuration.java View source code6 votesvote downvote up
@Beanpublic Docket petApi() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().pathMapping("/").directModelSubstitute(LocalDate.class, String.class).genericModelSubstitutes(ResponseEntity.class).alternateTypeRules(newRule(
					typeResolver.resolve(DeferredResult.class,
							typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
					typeResolver.resolve(WildcardType.class))).useDefaultResponseMessages(false).globalResponseMessage(RequestMethod.GET,
					newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build())).securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext())).enableUrlTemplating(true);}
Example 16
Project: fullstop   File: SwaggerConfig.java View source code6 votesvote downvote up
@Beanpublic Docket customImplementation() {return new Docket(DocumentationType.SWAGGER_2) //.apiInfo(apiInfo())                    //.select()                              //.paths(fullstopOnlyEndpoints())        //.build();}
Example 17
Project: jhipster-sample-app-elasticsearch   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();ApiInfo apiInfo = new ApiInfo(
        jHipsterProperties.getSwagger().getTitle(),
        jHipsterProperties.getSwagger().getDescription(),
        jHipsterProperties.getSwagger().getVersion(),
        jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
        jHipsterProperties.getSwagger().getContact(),
        jHipsterProperties.getSwagger().getLicense(),
        jHipsterProperties.getSwagger().getLicenseUrl());Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 18
Project: JTL-FIleService   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).directModelSubstitute(java.time.LocalDate.class, String.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}
Example 19
Project: ABC-Go   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * Swagger Springfox configuration.
 */@Beanpublic Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");StopWatch watch = new StopWatch();
    watch.start();Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).directModelSubstitute(org.joda.time.LocalDate.class, String.class).directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class).directModelSubstitute(org.joda.time.DateTime.class, Date.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());return docket;}




转载于:https://www.cnblogs.com/jeffen/p/6178044.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值