Class OpenAPISupport.Builder

  • All Implemented Interfaces:
    io.helidon.common.Builder<OpenAPISupport>, Supplier<OpenAPISupport>
    Direct Known Subclasses:
    SEOpenAPISupportBuilder
    Enclosing class:
    OpenAPISupport

    public abstract static class OpenAPISupport.Builder
    extends Object
    implements io.helidon.common.Builder<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).

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • 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:
        OpenApiConfig conveying how OpenAPI should behave
      • indexView

        public abstract org.jboss.jandex.IndexView indexView()
        Returns the Jandex IndexView containing annotated endpoint classes.
        Returns:
        IndexView containing endpoint classes
      • 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)
        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