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
All Implemented Interfaces:
Builder<B,T>, Supplier<T>
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 Details

    • CONFIG_KEY

      public static final String CONFIG_KEY
      Config key to select the openapi node from Helidon config.
      See Also:
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder()
  • Method Details

    • config

      public B config(Config config)
      Set various builder attributes from the specified Config object.

      The Config object can specify web-context and static-file in addition to settings supported by OpenAPIConfigImpl.Builder.

      Parameters:
      config - the openapi Config object possibly containing settings
      Returns:
      updated builder instance
      Throws:
      NullPointerException - if the provided Config is null
    • validate

      protected B validate() throws IllegalStateException
      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

      public B webContext(String path)
      Sets the web context path for the OpenAPI endpoint.
      Parameters:
      path - webContext to use, defaults to "/openapi"
      Returns:
      updated builder instance
    • staticFile

      public B staticFile(String path)
      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

      public B crossOriginConfig(CrossOriginConfig crossOriginConfig)
      Assigns the CORS settings for the OpenAPI endpoint.
      Parameters:
      crossOriginConfig - CrossOriginConfig containing CORS set-up
      Returns:
      updated builder instance
    • modelReader

      public B modelReader(String className)
      Sets the app-provided model reader class.
      Parameters:
      className - name of the model reader class
      Returns:
      updated builder instance
    • filter

      public B filter(String className)
      Set the app-provided OpenAPI model filter class.
      Parameters:
      className - name of the filter class
      Returns:
      updated builder instance
    • servers

      public B servers(String serverList)
      Sets the servers which offer the endpoints in the OpenAPI document.
      Parameters:
      serverList - comma-separated list of servers
      Returns:
      updated builder instance
    • addOperationServer

      public B addOperationServer(String operationID, String operationServer)
      Adds an operation server for a given operation ID.
      Parameters:
      operationID - operation ID to which the server corresponds
      operationServer - name of the server to add for this operation
      Returns:
      updated builder instance
    • addPathServer

      public B addPathServer(String path, String pathServer)
      Adds a path server for a given path.
      Parameters:
      path - path to which the server corresponds
      pathServer - name of the server to add for this path
      Returns:
      updated builder instance
    • indexViewsSupplier

      protected Supplier<List<? extends org.jboss.jandex.IndexView>> 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:
      OpenApiConfig conveying how OpenAPI should behave