Package io.micronaut.openapi.view
Class AbstractViewConfig
java.lang.Object
io.micronaut.openapi.view.AbstractViewConfig
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
- Direct Known Subclasses:
OpenApiExplorerConfig
,RapidocConfig
,RapiPDFConfig
,RedocConfig
,SwaggerUIConfig
public abstract class AbstractViewConfig
extends Object
implements io.micronaut.core.util.Toggleable
Abstract View Config.
- Author:
- croudet
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
URL and resource name. -
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected String
URL prefix for templates and resources.protected boolean
protected String
protected @Nullable Map<Pair<String,
String>, OpenApiInfo> protected String
protected String
protected String
protected String
protected String
protected String
URL prefix from config properties.protected List<AbstractViewConfig.OpenApiUrl>
protected boolean
protected Boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractViewConfig
(String prefix, Map<Pair<String, String>, OpenApiInfo> openApiInfos) An AbstractViewConfig. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttribute
(Map.Entry<String, String> entry) Adds an option.getConverter
(String key) Returns the converter associated with the key.protected String
getFinalUrlPrefix
(OpenApiViewConfig.RendererType rendererType, io.micronaut.inject.visitor.VisitorContext context) Calculate final URL prefix for resources.Get template path.getUrls()
Get urls for resources.abstract String
protected String
Converts to html attributes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
prefix
-
jsUrl
-
specUrl
-
urlPrefix
URL prefix from config properties. -
fullUrlPrefix
URL prefix for templates and resources. -
resourcesContextPath
-
templatePath
-
isDefaultJsUrl
protected boolean isDefaultJsUrl -
copyResources
protected boolean copyResources -
withFinalUrlPrefixCache
protected boolean withFinalUrlPrefixCache -
-
withUrls
-
urls
-
options
-
openApiInfos
-
-
Constructor Details
-
AbstractViewConfig
An AbstractViewConfig.- Parameters:
prefix
- The configuration key prefix.openApiInfos
- Information about all generated openAPI files.
-
-
Method Details
-
getConverter
Returns the converter associated with the key.- Parameters:
key
- A key.- Returns:
- A converter or null.
-
getResources
-
getTemplatePath
Get template path.- Returns:
- template path
-
render
-
addAttribute
Adds an option.- Parameters:
entry
- The user specified entry.
-
toHtmlAttributes
Converts to html attributes.- Returns:
- A String.
-
getFinalUrlPrefix
protected String getFinalUrlPrefix(OpenApiViewConfig.RendererType rendererType, io.micronaut.inject.visitor.VisitorContext context) Calculate final URL prefix for resources.- Parameters:
rendererType
- render typecontext
- visitor context- Returns:
- final URL prefix for resources
-
getUrls
Get urls for resources.- Returns:
- urls
-