-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(SwaggerUI): Add Swagger UI configuration parameters
- Loading branch information
1 parent
54eb2f5
commit 08c6fb1
Showing
3 changed files
with
164 additions
and
24 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
.../swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
package io.quarkus.swaggerui.deployment; | ||
|
||
import java.util.Optional; | ||
import java.util.OptionalInt; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
/** | ||
* Please @see <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration"</a> | ||
*/ | ||
@ConfigRoot | ||
class SwaggerUiConfig { | ||
/** | ||
* The path where Swagger UI is available. | ||
* <p> | ||
* The value `/` is not allowed as it blocks the application from serving anything else. | ||
*/ | ||
@ConfigItem(defaultValue = "/swagger-ui") | ||
String path; | ||
|
||
/** | ||
* If this should be included every time. By default, this is only included when the application is running | ||
* in dev mode. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean alwaysInclude; | ||
|
||
/** | ||
* URL to fetch external configuration document from. | ||
*/ | ||
@ConfigItem | ||
Optional<String> configUrl; | ||
|
||
/** | ||
* Enables deep linking for tags and operations. | ||
* | ||
* @see <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/deep-linking</a> | ||
*/ | ||
@ConfigItem | ||
Optional<Boolean> deepLinking; | ||
|
||
/** | ||
* The default expansion depth for models (set to -1 completely hide the models). | ||
*/ | ||
@ConfigItem | ||
OptionalInt defaultModelsExpandDepth; | ||
|
||
/** | ||
* The default expansion depth for the model on the model-example section. | ||
*/ | ||
@ConfigItem | ||
OptionalInt defaultModelExpandDepth; | ||
|
||
/** | ||
* Controls how the model is shown when the API is first rendered. | ||
*/ | ||
@ConfigItem | ||
Optional<String> defaultModelRendering; | ||
|
||
/** | ||
* Controls the display of operationId in operations list. | ||
*/ | ||
@ConfigItem | ||
Optional<Boolean> displayOperationId; | ||
|
||
/** | ||
* Controls the display of the request duration (in milliseconds) for Try-It-Out requests. | ||
*/ | ||
@ConfigItem | ||
Optional<Boolean> displayRequestDuration; | ||
|
||
/** | ||
* Controls the default expansion setting for the operations and tags. | ||
*/ | ||
@ConfigItem | ||
Optional<String> docExpansion; | ||
|
||
/** | ||
* If set, enables filtering. The top bar will show an edit box that could be used to filter | ||
* the tagged operations that are shown. | ||
*/ | ||
@ConfigItem | ||
Optional<String> filter; | ||
|
||
/** | ||
* If set, limits the number of tagged operations displayed to at most this many. | ||
*/ | ||
@ConfigItem | ||
Optional<Integer> maxDisplayedTags; | ||
|
||
/** | ||
* Controls the display of vendor extension (x-) fields and values. | ||
*/ | ||
@ConfigItem | ||
Optional<Boolean> showExtensions; | ||
|
||
/** | ||
* Controls the display of extensions | ||
*/ | ||
@ConfigItem | ||
Optional<Boolean> showCommonExtensions; | ||
|
||
/** | ||
* The url pointing to API definition (normally swagger.json/swagger.yaml/openapi.json/openapi.yaml). | ||
*/ | ||
@ConfigItem | ||
Optional<String> url; | ||
|
||
/** | ||
* Set a different validator URL, for example for locally deployed validators | ||
*/ | ||
@ConfigItem | ||
Optional<String> validatorUrl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters