public class OpenAPIService extends Object implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
OpenAPIService(Optional<io.swagger.v3.oas.models.OpenAPI> openAPI,
SecurityService securityParser,
SpringDocConfigProperties springDocConfigProperties,
PropertyResolverUtils propertyResolverUtils,
Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomizers,
Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomizers,
Optional<JavadocProvider> javadocProvider)
Instantiates a new Open api builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addMappings(Map<String,Object> mappings)
Add mappings.
|
void |
addTag(Set<org.springframework.web.method.HandlerMethod> handlerMethods,
io.swagger.v3.oas.models.tags.Tag tag)
Add tag.
|
io.swagger.v3.oas.models.OpenAPI |
build(Locale locale)
Build.
|
io.swagger.v3.oas.models.Operation |
buildTags(org.springframework.web.method.HandlerMethod handlerMethod,
io.swagger.v3.oas.models.Operation operation,
io.swagger.v3.oas.models.OpenAPI openAPI,
Locale locale)
Build tags operation.
|
void |
buildTagsFromClass(Class<?> beanType,
Set<io.swagger.v3.oas.models.tags.Tag> tags,
Set<String> tagsStr,
Locale locale)
Build tags from class.
|
io.swagger.v3.oas.models.OpenAPI |
getCachedOpenAPI(Locale locale)
Gets cached open api.
|
org.springframework.context.ApplicationContext |
getContext()
Gets context.
|
Map<String,Object> |
getControllerAdviceMap()
Gets controller advice map.
|
Map<String,Object> |
getMappingsMap()
Gets mappings map.
|
SecurityService |
getSecurityParser()
Gets security parser.
|
String |
getServerBaseUrl()
Gets server base URL
|
boolean |
isAutoTagClasses(io.swagger.v3.oas.models.Operation operation)
Is auto tag classes boolean.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setCachedOpenAPI(io.swagger.v3.oas.models.OpenAPI cachedOpenAPI,
Locale locale)
Sets cached open api.
|
void |
setServerBaseUrl(String serverBaseUrl)
Sets server base url.
|
void |
setServersPresent(boolean serversPresent)
Sets servers present.
|
static String |
splitCamelCase(String str)
Split camel case string.
|
void |
updateServers(io.swagger.v3.oas.models.OpenAPI openAPI)
Update servers open api.
|
public OpenAPIService(Optional<io.swagger.v3.oas.models.OpenAPI> openAPI, SecurityService securityParser, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomizers, Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomizers, Optional<JavadocProvider> javadocProvider)
openAPI
- the open apisecurityParser
- the security parserspringDocConfigProperties
- the spring doc config propertiespropertyResolverUtils
- the property resolver utilsopenApiBuilderCustomizers
- the open api builder customisersserverBaseUrlCustomizers
- the server base url customizersjavadocProvider
- the javadoc providerpublic static String splitCamelCase(String str)
str
- the strpublic io.swagger.v3.oas.models.OpenAPI build(Locale locale)
locale
- the localepublic void updateServers(io.swagger.v3.oas.models.OpenAPI openAPI)
openAPI
- the open apipublic void setServersPresent(boolean serversPresent)
serversPresent
- the servers presentpublic io.swagger.v3.oas.models.Operation buildTags(org.springframework.web.method.HandlerMethod handlerMethod, io.swagger.v3.oas.models.Operation operation, io.swagger.v3.oas.models.OpenAPI openAPI, Locale locale)
handlerMethod
- the handler methodoperation
- the operationopenAPI
- the open apilocale
- the localepublic void buildTagsFromClass(Class<?> beanType, Set<io.swagger.v3.oas.models.tags.Tag> tags, Set<String> tagsStr, Locale locale)
beanType
- the bean typetags
- the tagstagsStr
- the tags strlocale
- the localepublic boolean isAutoTagClasses(io.swagger.v3.oas.models.Operation operation)
operation
- the operationpublic void addTag(Set<org.springframework.web.method.HandlerMethod> handlerMethods, io.swagger.v3.oas.models.tags.Tag tag)
handlerMethods
- the handler methodstag
- the tagpublic Map<String,Object> getMappingsMap()
public void addMappings(Map<String,Object> mappings)
mappings
- the mappingspublic Map<String,Object> getControllerAdviceMap()
public io.swagger.v3.oas.models.OpenAPI getCachedOpenAPI(Locale locale)
locale
- associated the the cache entrypublic void setCachedOpenAPI(io.swagger.v3.oas.models.OpenAPI cachedOpenAPI, Locale locale)
cachedOpenAPI
- the cached open apilocale
- associated the the cache entrypublic org.springframework.context.ApplicationContext getContext()
public SecurityService getSecurityParser()
public String getServerBaseUrl()
public void setServerBaseUrl(String serverBaseUrl)
serverBaseUrl
- the server base urlpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
Copyright © 2024. All rights reserved.