springfox.documentation.service.ApiInfo配置示例

本文提供了多个使用 springfox.documentation.service.ApiInfo 的示例代码片段,这些示例来自不同的开源项目,展示了如何配置 API 的元数据,如标题、描述、许可证等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Java Code Examples for springfox.documentation.service.ApiInfo

The following are top voted examples for showing how to use springfox.documentation.service.ApiInfo. 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 code7 votesvote downvote up
private ApiInfo apiInfo() {return new ApiInfoBuilder().title("Learny Api").description("Hier steht die Beschreibung der Api").termsOfServiceUrl("http://springfox.io").contact("springfox").license("Apache License Version 2.0").licenseUrl("https://github.com/springfox/springfox/blob/master/LICENSE").version("2.0").build();}
Example 2
Project: jhipster_myapp   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}
Example 3
Project: swagger-codegen   File: SwaggerConfig.java View source code6 votesvote downvote up
@BeanApiInfo apiInfo() {ApiInfo apiInfo = new ApiInfo("Swagger Petstore","This is a sample server Petstore server.  You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger.  For this sample, you can use the api key \"special-key\" to test the authorization filters","1.0.0","","apiteam@swagger.io","Apache 2.0","http://www.apache.org/licenses/LICENSE-2.0.html" );return apiInfo;}
Example 4
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 5
Project: menuber   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}
Example 6
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 7
Project: bugkillers   File: SpringfoxConfig2.java View source code6 votesvote downvote up
private ApiInfo apiInfo() {ApiInfo apiInfo = new ApiInfo("???",
            PROJECT_NAME + " API",
            PROJECT_NAME + " ??API??","http://127.0.0.1:9081/api","hd.rd.cos@meituan.com","MTA License","MTA API License URL");return apiInfo;}
Example 8
Project: springfox-demos   File: Application.java View source code6 votesvote downvote up
private ApiInfo apiInfo() {return new ApiInfoBuilder().title("Springfox petstore API").description("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum " +"has been the industry's standard dummy text ever since the 1500s, when an unknown printer "+ "took a " +"galley of type and scrambled it to make a type specimen book. It has survived not only five " +"centuries, but also the leap into electronic typesetting, remaining essentially unchanged. " +"It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum " +"passages, and more recently with desktop publishing software like Aldus PageMaker including " +"versions of Lorem Ipsum.").termsOfServiceUrl("http://springfox.io").contact("springfox").license("Apache License Version 2.0").licenseUrl("https://github.com/springfox/springfox/blob/master/LICENSE").version("2.0").build();}
Example 9
Project: flipper-reverse-image-search   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}
Example 10
Project: jhipster-ionic   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}
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: 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 13
Project: spring-swagger2markup-demo   File: SwaggerConfig.java View source code6 votesvote downvote up
private ApiInfo apiInfo() {return new ApiInfoBuilder().title("Swagger Petstore").description("Petstore API Description").contact("apiteam@wordnik.com").license("Apache 2.0").licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html").version("1.0.0").build();}
Example 14
Project: fullstop   File: SwaggerConfig.java View source code6 votesvote downvote up
@BeanApiInfo apiInfo() {return new ApiInfo("Fullstop API","Audit reporting","","","","Apache 2.0","http://www.apache.org/licenses/LICENSE-2.0.html");}
Example 15
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 16
Project: JTL-FIleService   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}
Example 17
Project: ABC-Go   File: SwaggerConfiguration.java View source code6 votesvote downvote up
/**
 * API Info as it appears on the swagger-ui page.
 */private ApiInfo apiInfo() {return new ApiInfo(
        propertyResolver.getProperty("title"),
        propertyResolver.getProperty("description"),
        propertyResolver.getProperty("version"),
        propertyResolver.getProperty("termsOfServiceUrl"),
        propertyResolver.getProperty("contact"),
        propertyResolver.getProperty("license"),
        propertyResolver.getProperty("licenseUrl"));}




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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值