java.lang.Object
io.helidon.nima.openapi.OpenApiService
- All Implemented Interfaces:
HttpService,ServerLifecycle,Supplier<HttpService>
Provides an endpoint and supporting logic for returning an OpenAPI document
that describes the endpoints handled by the server.
The server can use the OpenApiService.Builder to set OpenAPI-related attributes. If
the server uses none of these builder methods and does not provide a static
openapi file, then the /openapi endpoint responds with a
nearly-empty OpenAPI document.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOpenApiService.AbstractBuilder<B extends OpenApiService.AbstractBuilder<B,T>, T extends OpenApiService> Base builder for OpenAPI service builders, extended byOpenApiService.Builderand MicroProfile implementation.static classFluent API builder forOpenApiService. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenApiService(OpenApiService.AbstractBuilder<?, ?> builder) Creates a new instance ofOpenAPISupport. -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenApiService.Builderbuilder()Creates a newOpenApiService.BuilderforOpenAPISupportusing defaults.voidconfigureEndpoint(HttpRules rules) Sets up the OpenAPI endpoint by adding routing to the specified rules set.static OpenApiServicecreate()Creates a newOpenApiServiceinstance using defaults.static OpenApiServiceCreates a newOpenApiServiceinstance using the 'openapi' portion of the providedConfigobject.protected voidTriggers preparation of the model from external code.voidUpdates the routing to add handlers of this service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.nima.webserver.http.HttpService
getMethods inherited from interface io.helidon.nima.webserver.ServerLifecycle
afterStop, beforeStart
-
Field Details
-
DEFAULT_WEB_CONTEXT
Default path for serving the OpenAPI document.- See Also:
-
DEFAULT_RESPONSE_MEDIA_TYPE
Default media type used in responses in absence of incoming Accept header.
-
-
Constructor Details
-
OpenApiService
Creates a new instance ofOpenAPISupport.- Parameters:
builder- the builder to use in constructing the instance
-
-
Method Details
-
builder
Creates a newOpenApiService.BuilderforOpenAPISupportusing defaults.- Returns:
- new Builder
-
create
Creates a newOpenApiServiceinstance using defaults.- Returns:
- new OpenAPISUpport
-
create
Creates a newOpenApiServiceinstance using the 'openapi' portion of the providedConfigobject.- Parameters:
config-Configobject containing OpenAPI-related settings- Returns:
- new
OpenAPISupportinstance created using the helidonConfig settings
-
routing
Description copied from interface:HttpServiceUpdates the routing to add handlers of this service.- Specified by:
routingin interfaceHttpService- Parameters:
rules- to update
-
configureEndpoint
Sets up the OpenAPI endpoint by adding routing to the specified rules set.- Parameters:
rules- routing rules to be augmented with OpenAPI endpoint
-
prepareModel
protected void prepareModel()Triggers preparation of the model from external code.
-