Module io.helidon.openapi
Package io.helidon.openapi
Class OpenAPISupport.Builder<B extends OpenAPISupport.Builder<B>>
- java.lang.Object
-
- io.helidon.openapi.OpenAPISupport.Builder<B>
-
- Type Parameters:
B
- concrete subclass of OpenAPISupport.Builder
- All Implemented Interfaces:
Builder<OpenAPISupport>
,Supplier<OpenAPISupport>
- Direct Known Subclasses:
MPOpenAPIBuilder
,SEOpenAPISupportBuilder
- Enclosing class:
- OpenAPISupport
public abstract static class OpenAPISupport.Builder<B extends OpenAPISupport.Builder<B>> extends Object implements Builder<OpenAPISupport>
Fluent API builder forOpenAPISupport
.This abstract implementation is extended once for use by developers from Helidon SE apps and once for use from the Helidon MP-provided OpenAPI service. This lets us constrain what use cases are possible from each (for example, no anno processing from SE).
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_KEY
Config key to select the openapi node from Helidon config.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description B
config(Config config)
Set various builder attributes from the specifiedConfig
object.B
crossOriginConfig(CrossOriginConfig crossOriginConfig)
Set the CORS config from the specifiedCrossOriginConfig
object.protected Supplier<List<? extends org.jboss.jandex.IndexView>>
indexViewsSupplier()
protected B
me()
abstract io.smallrye.openapi.api.OpenApiConfig
openAPIConfig()
Returns the smallrye OpenApiConfig instance describing the set-up that will govern the smallrye OpenAPI behavior.B
staticFile(String path)
Sets the location of the static OpenAPI document file.B
ui(OpenApiUi.Builder<?,?> uiBuilder)
Assigns the OpenAPI UI builder theOpenAPISupport
service should use in preparing the UI.void
validate()
Makes sure the set-up for OpenAPI is consistent, internally and with the current Helidon runtime environment (SE or MP).B
webContext(String path)
Path under which to register OpenAPI endpoint on the web server.
-
-
-
Field Detail
-
CONFIG_KEY
public static final String CONFIG_KEY
Config key to select the openapi node from Helidon config.- See Also:
- Constant Field Values
-
-
Method Detail
-
me
protected B me()
-
config
public B config(Config config)
Set various builder attributes from the specifiedConfig
object.The
Config
object can specify web-context and static-file in addition to settings supported byOpenAPIConfigImpl.Builder
.- Parameters:
config
- the openapiConfig
object possibly containing settings- Returns:
- updated builder instance
- Throws:
NullPointerException
- if the providedConfig
is null
-
openAPIConfig
public abstract io.smallrye.openapi.api.OpenApiConfig openAPIConfig()
Returns the smallrye OpenApiConfig instance describing the set-up that will govern the smallrye OpenAPI behavior.- Returns:
OpenApiConfig
conveying how OpenAPI should behave
-
validate
public void validate() throws IllegalStateException
Makes sure the set-up for OpenAPI is consistent, internally and with the current Helidon runtime environment (SE or MP).- Throws:
IllegalStateException
- if validation fails
-
webContext
public B webContext(String path)
Path under which to register OpenAPI endpoint on the web server.- Parameters:
path
- webContext to use, defaults to "/openapi"- Returns:
- updated builder instance
-
staticFile
public B staticFile(String path)
Sets the location of the static OpenAPI document file.- Parameters:
path
- non-null location of the static OpenAPI document file- Returns:
- updated builder instance
-
crossOriginConfig
public B crossOriginConfig(CrossOriginConfig crossOriginConfig)
Set the CORS config from the specifiedCrossOriginConfig
object.- Parameters:
crossOriginConfig
-CrossOriginConfig
containing CORS set-up- Returns:
- updated builder instance
-
ui
public B ui(OpenApiUi.Builder<?,?> uiBuilder)
Assigns the OpenAPI UI builder theOpenAPISupport
service should use in preparing the UI.- Parameters:
uiBuilder
- theOpenApiUi.Builder
- Returns:
- updated builder instance
-
-