- java.lang.Object
-
- io.helidon.openapi.OpenAPISupport
-
- All Implemented Interfaces:
Service
public abstract class OpenAPISupport extends Object implements Service
Provides an endpoint and supporting logic for returning an OpenAPI document that describes the endpoints handled by the server.The server can use the
OpenAPISupport.Builder
to set OpenAPI-related attributes. If the server uses none of these builder methods and does not provide a staticopenapi
file, then the/openapi
endpoint responds with a nearly-empty OpenAPI document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OpenAPISupport.Builder<B extends OpenAPISupport.Builder<B>>
Fluent API builder forOpenAPISupport
.
-
Field Summary
Fields Modifier and Type Field Description static MediaType
DEFAULT_RESPONSE_MEDIA_TYPE
Default media type used in responses in absence of incoming Accept header.static String
DEFAULT_WEB_CONTEXT
Default path for serving the OpenAPI document.
-
Constructor Summary
Constructors Modifier Constructor Description protected
OpenAPISupport(OpenAPISupport.Builder<?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SEOpenAPISupportBuilder
builder()
Creates a newOpenAPISupport.Builder
forOpenAPISupport
using defaults.void
configureEndpoint(Routing.Rules rules)
Sets up the OpenAPI endpoint by adding routing to the specified rules set.static OpenAPISupport
create()
Creates a newOpenAPISupport
instance using defaults.static OpenAPISupport
create(Config config)
Creates a newOpenAPISupport
instance using the 'openapi' portion of the providedConfig
object.protected void
prepareModel()
Triggers preparation of the model from external code.void
update(Routing.Rules rules)
UpdatesRouting.Rules
withhandlers
representing this service.String
webContext()
-
-
-
Field Detail
-
DEFAULT_WEB_CONTEXT
public static final String DEFAULT_WEB_CONTEXT
Default path for serving the OpenAPI document.- See Also:
- Constant Field Values
-
DEFAULT_RESPONSE_MEDIA_TYPE
public static final MediaType DEFAULT_RESPONSE_MEDIA_TYPE
Default media type used in responses in absence of incoming Accept header.
-
-
Constructor Detail
-
OpenAPISupport
protected OpenAPISupport(OpenAPISupport.Builder<?> builder)
-
-
Method Detail
-
update
public void update(Routing.Rules rules)
Description copied from interface:Service
UpdatesRouting.Rules
withhandlers
representing this service.
-
configureEndpoint
public void configureEndpoint(Routing.Rules rules)
Sets up the OpenAPI endpoint by adding routing to the specified rules set.- Parameters:
rules
- routing rules to be augmented with OpenAPI endpoint
-
webContext
public String webContext()
- Returns:
- the web context setting for this service
-
prepareModel
protected void prepareModel()
Triggers preparation of the model from external code.
-
builder
public static SEOpenAPISupportBuilder builder()
Creates a newOpenAPISupport.Builder
forOpenAPISupport
using defaults.- Returns:
- new Builder
-
create
public static OpenAPISupport create()
Creates a newOpenAPISupport
instance using defaults.- Returns:
- new OpenAPISUpport
-
create
public static OpenAPISupport create(Config config)
Creates a newOpenAPISupport
instance using the 'openapi' portion of the providedConfig
object.- Parameters:
config
-Config
object containing OpenAPI-related settings- Returns:
- new
OpenAPISupport
instance created using the helidonConfig settings
-
-