java.lang.Object
io.helidon.openapi.OpenApiUiBase
Common base class for implementations of @link OpenApiUi}.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
OpenApiUiBase.Builder<B extends OpenApiUiBase.Builder<B,
T>, T extends OpenApiUi> Common base builder implementation for creating a newOpenApiUi
. -
Field Summary
Fields inherited from interface io.helidon.openapi.OpenApiUi
UI_WEB_SUBCONTEXT
-
Constructor Summary
ModifierConstructorDescriptionprotected
OpenApiUiBase
(OpenApiUiBase.Builder<?, ?> builder, Function<MediaType, String> documentPreparer, String openAPIWebContext) Creates a new UI implementation from the specified builder and document preparer. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
options()
protected String
prepareDocument
(MediaType mediaType) Prepares a representation of the OpenAPI document in the specified media type.protected boolean
sendStaticText
(ServerRequest request, ServerResponse response, MediaType mediaType) Sends a static text response of the given media type.protected String
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.openapi.OpenApiUi
prepareTextResponseFromMainEndpoint, supportedMediaTypes
-
Constructor Details
-
OpenApiUiBase
protected OpenApiUiBase(OpenApiUiBase.Builder<?, ?> builder, Function<MediaType, String> documentPreparer, String openAPIWebContext) Creates a new UI implementation from the specified builder and document preparer.- Parameters:
builder
- the builder containing relevant settingsdocumentPreparer
- function returning an OpenAPI document represented as a specifiedMediaType
openAPIWebContext
- final web context for theOpenAPISupport
service
-
-
Method Details
-
isEnabled
protected boolean isEnabled()- Returns:
- whether the UI is enabled
-
prepareDocument
Prepares a representation of the OpenAPI document in the specified media type.- Parameters:
mediaType
- media type in which to express the document- Returns:
- representation of the OpenAPI document
-
webContext
- Returns:
- web context this UI implementation responds at
-
options
- Returns:
- options set for this UI implementation (unmodifiable)
-
sendStaticText
protected boolean sendStaticText(ServerRequest request, ServerResponse response, MediaType mediaType) Sends a static text response of the given media type.- Parameters:
request
- the request to respond toresponse
- the responsemediaType
- theMediaType
with which to respond, if possible- Returns:
- whether the implementation responded with a static text response
-