Package io.micronaut.openapi.view
Class OpenApiViewConfig
- java.lang.Object
-
- io.micronaut.openapi.view.OpenApiViewConfig
-
public final class OpenApiViewConfig extends java.lang.ObjectOpenApi view configuration for Swagger-ui, ReDoc and RapiDoc. By default no views are enabled.- See Also:
- Swagger-ui, ReDoc, RapiDoc
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESOURCE_DIRstatic java.lang.StringSLASHstatic java.lang.StringTEMPLATESstatic java.lang.StringTEMPLATES_RAPIDOCstatic java.lang.StringTEMPLATES_RAPIPDFstatic java.lang.StringTEMPLATES_REDOCstatic java.lang.StringTEMPLATES_SWAGGER_UIstatic java.lang.StringTHEMES_DIR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpenApiViewConfigfromSpecification(java.lang.String specification, java.util.Properties openApiProperties)Creates an OpenApiViewConfig form a String representation.java.lang.StringgetSpecURL()Returns the relative openApi specification url path.java.lang.StringgetTitle()Returns the title for the generated views.booleanisEnabled()Returns true when the generation of views is enabled.voidrender(java.nio.file.Path outputDir, io.micronaut.inject.visitor.VisitorContext visitorContext)Generates the views given this configuration.voidsetServerContextPath(java.lang.String contextPath)Sets the server context path.voidsetSpecFile(java.lang.String specFile)Sets the generated openApi specification file name.voidsetTitle(java.lang.String title)Sets the title for the generated views.
-
-
-
Field Detail
-
RESOURCE_DIR
public static final java.lang.String RESOURCE_DIR
- See Also:
- Constant Field Values
-
THEMES_DIR
public static final java.lang.String THEMES_DIR
- See Also:
- Constant Field Values
-
TEMPLATES
public static final java.lang.String TEMPLATES
- See Also:
- Constant Field Values
-
TEMPLATES_RAPIPDF
public static final java.lang.String TEMPLATES_RAPIPDF
- See Also:
- Constant Field Values
-
TEMPLATES_SWAGGER_UI
public static final java.lang.String TEMPLATES_SWAGGER_UI
- See Also:
- Constant Field Values
-
TEMPLATES_REDOC
public static final java.lang.String TEMPLATES_REDOC
- See Also:
- Constant Field Values
-
TEMPLATES_RAPIDOC
public static final java.lang.String TEMPLATES_RAPIDOC
- See Also:
- Constant Field Values
-
SLASH
public static final java.lang.String SLASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromSpecification
public static OpenApiViewConfig fromSpecification(java.lang.String specification, java.util.Properties openApiProperties)
Creates an OpenApiViewConfig form a String representation.- Parameters:
specification- A String representation of an OpenApiViewConfig.openApiProperties- The open api properties.- Returns:
- An OpenApiViewConfig.
-
isEnabled
public boolean isEnabled()
Returns true when the generation of views is enabled.- Returns:
- true when the generation of views is enabled.
-
render
public void render(java.nio.file.Path outputDir, io.micronaut.inject.visitor.VisitorContext visitorContext) throws java.io.IOExceptionGenerates the views given this configuration.- Parameters:
outputDir- The destination directory of the generated views.visitorContext- The visitor context- Throws:
java.io.IOException- When the generation fails.
-
setServerContextPath
public void setServerContextPath(java.lang.String contextPath)
Sets the server context path.- Parameters:
contextPath- The server context path.
-
getTitle
public java.lang.String getTitle()
Returns the title for the generated views.- Returns:
- A title.
-
setTitle
public void setTitle(java.lang.String title)
Sets the title for the generated views.- Parameters:
title- A title.
-
getSpecURL
public java.lang.String getSpecURL()
Returns the relative openApi specification url path.- Returns:
- A path.
-
setSpecFile
public void setSpecFile(java.lang.String specFile)
Sets the generated openApi specification file name.- Parameters:
specFile- The openApi specification file name.
-
-