Quarkus Redoc

This extension provides Redoc API documentation for your Quarkus application. Redoc is an open source tool for generating documentation from OpenAPI (formerly Swagger) definitions.

This extension uses Redoc 3.0 and supports all Redoc Community Edition (CE) configuration options.

Features

Specify Download URLs By default, this extension configures Redoc CE to show download URLs for the OpenAPI document in both JSON and YAML format.

You can disable them completely using the following configuration.

quarkus.redoc.hide-download-buttons=true

You can also override the default provided download URLs with your own. For example, if your API is about users, you could change the URLs as follows.

quarkus.redoc.download-urls[0].title=User API JSON
quarkus.redoc.download-urls[0].url=/q/openapi.json
quarkus.redoc.download-urls[1].title=User API YAML
quarkus.redoc.download-urls[1].url=/q/openapi.yaml

You can provide as many download URLs as you want. See also how to configure indexed properties in the Quarkus documentation: https://quarkus.io/guides/config-reference#indexed-properties

Installation

If you want to use this extension, you need to add the io.quarkiverse.redoc:quarkus-redoc extension first to your build file.

For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.redoc</groupId>
    <artifactId>quarkus-redoc</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

Once installed, Redoc will be available at /q/redoc in dev and test modes. Simply navigate to that URL to view your API documentation.

Extension Configuration Reference

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Type

Default

The path where Redoc UI is served (relative to non-application root path). The default is "redoc", which means Redoc will be available at /q/redoc.

Environment variable: QUARKUS_REDOC_PATH

string

redoc

The title displayed in the browser tab.

Environment variable: QUARKUS_REDOC_TITLE

string

API Documentation

If true, Redoc is included in production builds. By default, Redoc is only available in dev and test modes.

Environment variable: QUARKUS_REDOC_ALWAYS_INCLUDE

boolean

false

Hides the 'Download' button for saving the API definition source file. This setting does not make the API definition private; it just hides the button.

Environment variable: QUARKUS_REDOC_HIDE_DOWNLOAD_BUTTONS

boolean

false

Hides the schema title next to the type.

Environment variable: QUARKUS_REDOC_HIDE_SCHEMA_TITLES

boolean

false

Sets the default expand level for JSON payload samples (response and request body). The default value is 2, and the maximum supported value is '+Infinity'. It can also be configured as a string with the special value all that expands all levels.

Environment variable: QUARKUS_REDOC_JSON_SAMPLES_EXPAND_LEVEL

string

2

Displays only the specified number of enum values. The remaining values are hidden in an expandable area. By default 10 values are displayed which is ideal for usability.

Environment variable: QUARKUS_REDOC_MAX_DISPLAYED_ENUM_VALUES

int

10

Controls how API documentation panels are displayed on the page.

  • three-panel - Standard layout with sidebar on the left, main content in the center, and code samples on the right

  • stacked - Alternative layout that integrates the right panel into the middle panel, creating a single-column view. Better for narrower viewports or sequential reading

Environment variable: QUARKUS_REDOC_LAYOUT

three-panel, stacked

three-panel

Shows only required fields in request samples. Use this option if you have a large number of optional fields that can make request samples difficult to read.

Environment variable: QUARKUS_REDOC_ONLY_REQUIRED_IN_SAMPLES

boolean

false

Shows required properties in schemas first, ordered in the same order as in the required array.

Environment variable: QUARKUS_REDOC_SORT_REQUIRED_PROPS_FIRST

boolean

false

Specifies whether to automatically expand schemas in Reference docs. Set it to all to expand all schemas regardless of their level, or set it to a number to expand schemas up to the specified level. For example, schemasExpansionLevel: 3 expands schemas up to three levels deep.

Environment variable: QUARKUS_REDOC_SCHEMAS_EXPANSION_LEVEL

string

4

Specifies a vertical scroll-offset in pixels. This setting is useful when there are fixed positioned elements at the top of the page, such as navbars, headers, etc.

Environment variable: QUARKUS_REDOC_SCROLL_Y_OFFSET

int

Shows specification extensions ('x-' fields). Extensions used by Redoc are ignored.

The value can be:

  • true - show all specification extensions

  • false - hide all specification extensions (default)

  • a comma-separated list of extension names to display (e.g., x-logo,x-code-samples)

Environment variable: QUARKUS_REDOC_SHOW_EXTENSIONS

string

false

If set to true, the spec is considered untrusted and all HTML/Markdown is sanitized.

Environment variable: QUARKUS_REDOC_SANITIZE

boolean

false

The title/label for this download option (e.g., "YAML", "JSON").

Environment variable: QUARKUS_REDOC_DOWNLOAD_URLS_TITLE

string

required

The URL to download the API definition from.

Environment variable: QUARKUS_REDOC_DOWNLOAD_URLS_URL

string

required

If a value is set, all of the schemas are rendered with the designated tag name. The schemas then render and display in the sidebar navigation (with that associated tag name).

Environment variable: QUARKUS_REDOC_SCHEMA_DEFINITIONS_TAG_NAME

string

Schemas

The generatedSamplesMaxDepth option controls how many schema levels automatically generated for payload samples. The default is 8 which works well for most APIs, but you can adjust it if necessary for your use case.

Environment variable: QUARKUS_REDOC_GENERATED_SAMPLES_MAX_DEPTH

int

8

In complex data structures or object schemas where properties are nested within parent objects the hidePropertiesPrefix option enables the hiding of parent names for nested properties within the documentation.

Environment variable: QUARKUS_REDOC_HIDE_PROPERTIES_PREFIX

boolean

false

A list of schema names to ignore. Matching schemas are excluded from the documentation. Multiple schema names can be specified.

Environment variable: QUARKUS_REDOC_IGNORE_NAMED_SCHEMAS

list of string

Hides the loading animation.

Environment variable: QUARKUS_REDOC_HIDE_LOADING

boolean

false

Hides the sidebar navigation menu.

Environment variable: QUARKUS_REDOC_HIDE_SIDEBAR

boolean

false

Whether Redoc is enabled at runtime. If false, the Redoc UI will return a 404 response.

Environment variable: QUARKUS_REDOC_ENABLED

boolean

true