Class UiConfigurationBuilder


  • public class UiConfigurationBuilder
    extends java.lang.Object
    • Method Detail

      • deepLinking

        public UiConfigurationBuilder deepLinking​(java.lang.Boolean deepLinking)
        Parameters:
        deepLinking - If set to true, enables deep linking for tags and operations. See the Deep Linking documentation for more information.
        Returns:
        this
      • displayOperationId

        public UiConfigurationBuilder displayOperationId​(java.lang.Boolean displayOperationId)
        Parameters:
        displayOperationId - Controls the display of operationId in operations list. The default is false.
        Returns:
        this
      • defaultModelsExpandDepth

        public UiConfigurationBuilder defaultModelsExpandDepth​(java.lang.Integer defaultModelsExpandDepth)
        Parameters:
        defaultModelsExpandDepth - The default expansion depth for models (set to -1 completely hide the models).
        Returns:
        this
      • defaultModelExpandDepth

        public UiConfigurationBuilder defaultModelExpandDepth​(java.lang.Integer defaultModelExpandDepth)
        Parameters:
        defaultModelExpandDepth - The default expansion depth for the model on the model-example section.
        Returns:
        this
      • defaultModelRendering

        public UiConfigurationBuilder defaultModelRendering​(ModelRendering defaultModelRendering)
        Parameters:
        defaultModelRendering - Controls how the model is shown when the API is first rendered. (The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links.)
        Returns:
        this
      • displayRequestDuration

        public UiConfigurationBuilder displayRequestDuration​(java.lang.Boolean displayRequestDuration)
        Parameters:
        displayRequestDuration - Controls the display of the request duration (in milliseconds) for Try-It-Out requests.
        Returns:
        this
      • docExpansion

        public UiConfigurationBuilder docExpansion​(DocExpansion docExpansion)
        Parameters:
        docExpansion - Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing).
        Returns:
        this
      • filter

        public UiConfigurationBuilder filter​(java.lang.Object filter)
        Parameters:
        filter - If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag.
        Returns:
        this
      • maxDisplayedTags

        public UiConfigurationBuilder maxDisplayedTags​(java.lang.Integer maxDisplayedTags)
        Parameters:
        maxDisplayedTags - If set, limits the number of tagged operations displayed to at most this many. The default is to show all operations.
        Returns:
        this
      • operationsSorter

        public UiConfigurationBuilder operationsSorter​(OperationsSorter operationsSorter)
        Parameters:
        operationsSorter - Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
        Returns:
        this
      • showExtensions

        public UiConfigurationBuilder showExtensions​(java.lang.Boolean showExtensions)
        Parameters:
        showExtensions - Controls the display of vendor extension (x-) fields and values for Operations, Parameters, and Schema.
        Returns:
        this
      • showCommonExtensions

        public UiConfigurationBuilder showCommonExtensions​(java.lang.Boolean showCommonExtensions)
        Parameters:
        showCommonExtensions - Controls the display of extensions (pattern, maxLength, minLength, maximum, minimum) fields and values for Parameters.
        Returns:
        this
      • tagsSorter

        public UiConfigurationBuilder tagsSorter​(TagsSorter tagsSorter)
        Parameters:
        tagsSorter - Apply a sort to the tag list of each API. It can be 'alpha' (sort by paths alphanumerically) or a function (see Array.prototype.sort() to learn how to write a sort function). Two tag name strings are passed to the sorter for each pass. Default is the order determined by Swagger-UI.
        Returns:
        this
      • supportedSubmitMethods

        public UiConfigurationBuilder supportedSubmitMethods​(java.lang.String[] supportedSubmitMethods)
        Parameters:
        supportedSubmitMethods - List of HTTP methods that have the Try it out feature enabled. An empty array disables Try it out for all operations. This does not filter the operations from the display.
        Returns:
        this
      • validatorUrl

        public UiConfigurationBuilder validatorUrl​(java.lang.String validatorUrl)
        Parameters:
        validatorUrl - By default, Swagger-UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge). Setting it to null will disable validation. This parameter is relevant for Swagger 2.0 specs only.
        Returns:
        this