- java.lang.Object
-
- io.helidon.openapi.OpenAPISupport.Builder
-
- All Implemented Interfaces:
Builder<OpenAPISupport>,Supplier<OpenAPISupport>
- Direct Known Subclasses:
MPOpenAPIBuilder,SEOpenAPISupportBuilder
- Enclosing class:
- OpenAPISupport
public abstract static class OpenAPISupport.Builder 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 StringCONFIG_KEYConfig key to select the openapi node from Helidon config.
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OpenAPISupportbuild()Build the instance from this builder.OpenAPISupport.Builderconfig(Config config)Set various builder attributes from the specifiedConfigobject.OpenAPISupport.BuildercrossOriginConfig(CrossOriginConfig crossOriginConfig)Set the CORS config from the specifiedCrossOriginConfigobject.abstract io.smallrye.openapi.api.OpenApiConfigopenAPIConfig()Returns the smallrye OpenApiConfig instance describing the set-up that will govern the smallrye OpenAPI behavior.abstract List<io.smallrye.openapi.runtime.scanner.FilteredIndexView>perAppFilteredIndexViews()Returns zero or moreFilteredIndexViewinstances, each of which to be used in constructing an OpenAPI model that is merged with the others.OpenAPISupport.BuilderstaticFile(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).OpenAPISupport.BuilderwebContext(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
-
build
public OpenAPISupport build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<OpenAPISupport>- Returns:
- instance of the built type
-
config
public OpenAPISupport.Builder config(Config 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
public void validate() throws IllegalStateExceptionMakes 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 OpenAPISupport.Builder 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 OpenAPISupport.Builder 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 OpenAPISupport.Builder crossOriginConfig(CrossOriginConfig crossOriginConfig)
Set the CORS config from the specifiedCrossOriginConfigobject.- Parameters:
crossOriginConfig-CrossOriginConfigcontaining CORS set-up- Returns:
- updated builder instance
-
perAppFilteredIndexViews
public abstract List<io.smallrye.openapi.runtime.scanner.FilteredIndexView> perAppFilteredIndexViews()
Returns zero or moreFilteredIndexViewinstances, each of which to be used in constructing an OpenAPI model that is merged with the others. This is particularly useful for supporting multipleApplicationinstances in a single server.- Returns:
- possibly empty
ListofFilteredIndexViewobjects
-
-