类 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.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidprivate io.swagger.v3.oas.models.security.SecuritySchemesecurityScheme(SwaggerProperties swaggerProperties) voidsetApplicationContext(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
-
字段详细资料
-
path
-
applicationContext
private org.springframework.context.ApplicationContext applicationContext
-
-
构造器详细资料
-
OpenAPIDefinition
public OpenAPIDefinition()
-
-
方法详细资料
-
securityScheme
private io.swagger.v3.oas.models.security.SecurityScheme securityScheme(SwaggerProperties swaggerProperties) -
afterPropertiesSet
- 指定者:
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
-