类 OpenAPIDefinition

java.lang.Object
io.swagger.v3.oas.models.OpenAPI
com.sie.mbm.mom.framework.swagger.config.OpenAPIDefinition
所有已实现的接口:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

@ConditionalOnProperty(name="swagger.enabled", matchIfMissing=true) public class OpenAPIDefinition extends io.swagger.v3.oas.models.OpenAPI implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
swagger配置

禁用方法1:使用注解@Profile({"dev","test"}) 表示在开发或测试环境开启,而在生产关闭。(推荐使用) 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable", havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger.

  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private org.springframework.context.ApplicationContext
     
    private String
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
     
    private io.swagger.v3.oas.models.security.SecurityScheme
    securityScheme(SwaggerProperties swaggerProperties)
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     

    从类继承的方法 io.swagger.v3.oas.models.OpenAPI

    addExtension, addExtension31, addSecurityItem, addServersItem, addTagsItem, addWebhooks, components, equals, extensions, externalDocs, getComponents, getExtensions, getExternalDocs, getInfo, getJsonSchemaDialect, getOpenapi, getPaths, getSecurity, getServers, getSpecVersion, getTags, getWebhooks, hashCode, info, jsonSchemaDialect, openapi, path, paths, schema, schemaRequirement, security, servers, setComponents, setExtensions, setExternalDocs, setInfo, setJsonSchemaDialect, setOpenapi, setPaths, setSecurity, setServers, setSpecVersion, setTags, setWebhooks, specVersion, tags, toString, webhooks

    从类继承的方法 java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 字段详细资料

    • path

      private String path
    • applicationContext

      private org.springframework.context.ApplicationContext applicationContext
  • 构造器详细资料

    • OpenAPIDefinition

      public OpenAPIDefinition()
  • 方法详细资料

    • securityScheme

      private io.swagger.v3.oas.models.security.SecurityScheme securityScheme(SwaggerProperties swaggerProperties)
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      指定者:
      afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
      抛出:
      Exception
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      指定者:
      setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
      抛出:
      org.springframework.beans.BeansException