From 4651c2c65fe818bb7db70208f4a9c6289f9b0eb9 Mon Sep 17 00:00:00 2001 From: Vojtech Knyttl Date: Mon, 21 Feb 2022 09:00:20 +0100 Subject: [PATCH] Add FAQ record for setting up swagger properties programmatically --- src/docs/asciidoc/faq.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/docs/asciidoc/faq.adoc b/src/docs/asciidoc/faq.adoc index 2333480..5005f35 100644 --- a/src/docs/asciidoc/faq.adoc +++ b/src/docs/asciidoc/faq.adoc @@ -130,6 +130,19 @@ springdoc.pathsToMatch=/v1, /api/balance/** springdoc.packagesToScan=package1, package2 ---- +=== How can I set Swagger properties programmatically? + +These can be set by creating a `swaggerUiConfig` bean as follows: + +--- + @Bean + fun swaggerUiConfig(config: SwaggerUiConfigProperties): SwaggerUiConfigProperties { + config.showCommonExtensions = true + config.queryConfigEnabled = true + return config + } +--- + === How can I ignore some field of model ? * You can use the following annotation on the top of the field that you want to hide: * `@Schema(hidden = true)`