- java.lang.Object
-
- io.helidon.openapi.OpenApiUiBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static 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
Constructors Modifier Constructor Description protected
OpenApiUiBase(OpenApiUiBase.Builder<?,?> builder, Function<MediaType,String> documentPreparer, String openAPIWebContext)
Creates a new UI implementation from the specified builder and document preparer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isEnabled()
protected Map<String,String>
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
webContext()
-
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 Detail
-
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 Detail
-
isEnabled
protected boolean isEnabled()
- Returns:
- whether the UI is enabled
-
prepareDocument
protected String prepareDocument(MediaType mediaType)
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
protected String webContext()
- Returns:
- web context this UI implementation responds at
-
options
protected Map<String,String> 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
-
-