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<B,,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<B,OpenAPISupport>
Fluent API builder for
OpenAPISupport.
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
FieldsModifier and TypeFieldDescriptionstatic final StringConfig key to select the openapi node from Helidon config. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet various builder attributes from the specifiedConfigobject.crossOriginConfig(CrossOriginConfig crossOriginConfig) Set the CORS config from the specifiedCrossOriginConfigobject.Returns the supplier of index views.abstract io.smallrye.openapi.api.OpenApiConfigReturns the smallrye OpenApiConfig instance describing the set-up that will govern the smallrye OpenAPI behavior.staticFile(String path) Sets the location of the static OpenAPI document file.voidvalidate()Makes sure the set-up for OpenAPI is consistent, internally and with the current Helidon runtime environment (SE or MP).webContext(String path) Path under which to register OpenAPI endpoint on the web server.
-
Field Details
-
CONFIG_KEY
Config key to select the openapi node from Helidon config.- See Also:
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
config
Set various builder attributes from the specifiedConfigobject.The
Configobject can specify web-context and static-file in addition to settings supported byOpenAPIConfigImpl.Builder.- Parameters:
config- the openapiConfigobject possibly containing settings- Returns:
- updated builder instance
- Throws:
NullPointerException- if the providedConfigis 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:
OpenApiConfigconveying how OpenAPI should behave
-
validate
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
Path under which to register OpenAPI endpoint on the web server.- Parameters:
path- webContext to use, defaults to "/openapi"- Returns:
- updated builder instance
-
staticFile
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
Set the CORS config from the specifiedCrossOriginConfigobject.- Parameters:
crossOriginConfig-CrossOriginConfigcontaining CORS set-up- Returns:
- updated builder instance
-
indexViewsSupplier
Returns the supplier of index views.- Returns:
- index views supplier
-