Class OpenAPISupport.Builder

java.lang.Object
io.helidon.reactive.openapi.OpenAPISupport.Builder
All Implemented Interfaces:
Builder<OpenAPISupport.Builder,OpenAPISupport>, Supplier<OpenAPISupport>
Enclosing class:
OpenAPISupport

public static class OpenAPISupport.Builder extends Object implements Builder<OpenAPISupport.Builder,OpenAPISupport>
Fluent API builder for OpenAPISupport.
  • Field Details

    • CONFIG_KEY

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

    • build

      public OpenAPISupport build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<OpenAPISupport.Builder,OpenAPISupport>
      Returns:
      instance of the built type
    • config

      public OpenAPISupport.Builder 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

      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 OpenAPISupport.Builder 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 OpenAPISupport.Builder 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 OpenAPISupport.Builder crossOriginConfig(CrossOriginConfig crossOriginConfig)
      Assigns the CORS settings for the OpenAPI endpoint.
      Parameters:
      crossOriginConfig - CrossOriginConfig containing CORS set-up
      Returns:
      updated builder instance
    • modelReader

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

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

      public OpenAPISupport.Builder 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 OpenAPISupport.Builder 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 OpenAPISupport.Builder 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