Class OpenApiUiBase

  • All Implemented Interfaces:
    OpenApiUi, Service

    public abstract class OpenApiUiBase
    extends Object
    implements OpenApiUi
    Common base class for implementations of @link OpenApiUi}.
    • 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.
        builder - the builder containing relevant settings
        documentPreparer - function returning an OpenAPI document represented as a specified MediaType
        openAPIWebContext - final web context for the OpenAPISupport service
    • Method Detail

      • isEnabled

        protected boolean isEnabled()
        whether the UI is enabled
      • prepareDocument

        protected String prepareDocument​(MediaType mediaType)
        Prepares a representation of the OpenAPI document in the specified media type.
        mediaType - media type in which to express the document
        representation of the OpenAPI document
      • webContext

        protected String webContext()
        web context this UI implementation responds at
      • options

        protected Map<String,​String> options()
        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.
        request - the request to respond to
        response - the response
        mediaType - the MediaType with which to respond, if possible
        whether the implementation responded with a static text response