SpringdocAutoConfiguration

@AutoConfiguration(after = [WowAutoConfiguration::class], beforeName = ["org.springdoc.core.configuration.SpringDocConfiguration"])
@ConditionalOnClass(name = ["org.springdoc.core.customizers.OpenApiCustomizer", "io.swagger.v3.core.util.Json31"])
@ConditionalOnBean(value = [ServiceNode::class])
@ConditionalOnProperty(prefix = "wow.http.openapi.springdoc", name = ["enabled"], matchIfMissing = true)
class SpringdocAutoConfiguration

The springdoc bridge (gap): with springdoc on the classpath, the OpenAPI document of the public routes, the one GET /wow/openapi answers (wowOpenApi), joins springdoc's, so that /v3/api-docs and Swagger UI list the application's own controllers and the Wow routes together.

  • wowOpenApiCustomizer merges the Wow document into springdoc's default document (SpringdocMerge): a route both define (path and method) or a component name both use for different definitions fails the startup, since wowSpringdocStartupCheck renders the default document once the beans are ready, as springdoc's pre-loading does.

  • wowGroupedOpenApi is the group wow.http.openapi.springdoc.group (wow, /v3/api-docs/wow): the Wow routes alone, none of the application's. Swagger UI lists the default document first (wowSwaggerUiDefaultDocument), then the groups.

  • The document's security schemes and global security are the WowOpenApiSecurity bean's: the host's from its CallerResolver (CoSec's bearer token), unless the application gives its own.

  • The document has the public port's routes alone: the internal port's call routes, cluster channel and signals are never in it. /v3/api-docs and Swagger UI are springdoc's, guarded by the application's security configuration; GET /wow/openapi is unchanged.

wow.http.openapi.springdoc.enabled=false turns the bridge off.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun wowGroupedOpenApi(document: SpringdocDocument, properties: WowProperties): GroupedOpenApi

The group of the Wow routes alone: none of the application's controllers or router functions.

Link copied to clipboard
fun wowOpenApiCustomizer(document: SpringdocDocument): OpenApiCustomizer

Merges the Wow routes into springdoc's default document (/v3/api-docs).

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowOpenApiSecurity(callers: CallerResolver): WowOpenApiSecurity
Link copied to clipboard
fun wowSpringdocDocument(manifest: Manifest, options: WowHttpOptions, queries: ObjectProvider<HttpQueries>, security: WowOpenApiSecurity): SpringdocDocument

The Wow document, rendered once at startup; each springdoc document reads a copy of it.

Link copied to clipboard
fun wowSpringdocStartupCheck(resources: ObjectProvider<AbstractOpenApiResource>): SmartInitializingSingleton

Renders springdoc's default document once every bean is ready, so that a conflict with the Wow routes fails the startup rather than the first request; springdoc keeps the document it rendered.