Module io.helidon.nima.openapi
Package io.helidon.nima.openapi
Class OpenApiService.AbstractBuilder<B extends OpenApiService.AbstractBuilder<B,T>,T extends OpenApiService>
java.lang.Object
io.helidon.nima.openapi.OpenApiService.AbstractBuilder<B,T>
- Type Parameters:
B- type of the builder (subclass)T- type of the built target
- Direct Known Subclasses:
MPOpenAPIBuilder,OpenApiService.Builder
- Enclosing class:
OpenApiService
public abstract static class OpenApiService.AbstractBuilder<B extends OpenApiService.AbstractBuilder<B,T>,T extends OpenApiService>
extends Object
implements Builder<B,T>
Base builder for OpenAPI service builders, extended by
OpenApiService.Builder
and MicroProfile implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfig key to select the openapi node from Helidon config. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOperationServer(String operationID, String operationServer) Adds an operation server for a given operation ID.addPathServer(String path, String pathServer) Adds a path server for a given path.Set various builder attributes from the specifiedConfigobject.crossOriginConfig(CrossOriginConfig crossOriginConfig) Assigns the CORS settings for the OpenAPI endpoint.Set the app-provided OpenAPI model filter class.Returns the supplier of index views.modelReader(String className) Sets the app-provided model reader class.protected io.smallrye.openapi.api.OpenApiConfigReturns the smallrye OpenApiConfig instance describing the set-up that will govern the smallrye OpenAPI behavior.Sets the servers which offer the endpoints in the OpenAPI document.staticFile(String path) Sets the file system path of the static OpenAPI document file.protected Bvalidate()Makes sure the set-up for OpenAPI is consistent, internally and with the current Helidon runtime environment (SE or MP).webContext(String path) Sets the web context path for the OpenAPI endpoint.
-
Field Details
-
CONFIG_KEY
Config key to select the openapi node from Helidon config.- See Also:
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
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
-
validate
Makes sure the set-up for OpenAPI is consistent, internally and with the current Helidon runtime environment (SE or MP).- Returns:
- this builder
- Throws:
IllegalStateException- if validation fails
-
webContext
Sets the web context path for the OpenAPI endpoint.- Parameters:
path- webContext to use, defaults to "/openapi"- Returns:
- updated builder instance
-
staticFile
Sets the file system path of the static OpenAPI document file. Default types are `json`, `yaml`, and `yml`.- Parameters:
path- non-null location of the static OpenAPI document file- Returns:
- updated builder instance
-
crossOriginConfig
Assigns the CORS settings for the OpenAPI endpoint.- Parameters:
crossOriginConfig-CrossOriginConfigcontaining CORS set-up- Returns:
- updated builder instance
-
modelReader
Sets the app-provided model reader class.- Parameters:
className- name of the model reader class- Returns:
- updated builder instance
-
filter
Set the app-provided OpenAPI model filter class.- Parameters:
className- name of the filter class- Returns:
- updated builder instance
-
servers
Sets the servers which offer the endpoints in the OpenAPI document.- Parameters:
serverList- comma-separated list of servers- Returns:
- updated builder instance
-
addOperationServer
Adds an operation server for a given operation ID.- Parameters:
operationID- operation ID to which the server correspondsoperationServer- name of the server to add for this operation- Returns:
- updated builder instance
-
addPathServer
Adds a path server for a given path.- Parameters:
path- path to which the server correspondspathServer- name of the server to add for this path- Returns:
- updated builder instance
-
indexViewsSupplier
Returns the supplier of index views.- Returns:
- index views supplier
-
openAPIConfig
protected 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
-