init security scheme (#29)
This commit is contained in:
@ -101,7 +101,11 @@ object Kompendium {
|
||||
deprecated = this.deprecated,
|
||||
parameters = paramType.toParameterSpec(),
|
||||
responses = responseType.toResponseSpec(responseInfo)?.let { mapOf(it) },
|
||||
requestBody = if (method != HttpMethod.Get) requestType.toRequestSpec(requestInfo) else null
|
||||
requestBody = if (method != HttpMethod.Get) requestType.toRequestSpec(requestInfo) else null,
|
||||
security = if (this.securitySchemes.isNotEmpty()) listOf(
|
||||
// TODO support scopes
|
||||
this.securitySchemes.associateWith { listOf() }
|
||||
) else null
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
|
@ -7,5 +7,6 @@ data class MethodInfo(
|
||||
val responseInfo: ResponseInfo? = null,
|
||||
val requestInfo: RequestInfo? = null,
|
||||
val tags: Set<String> = emptySet(),
|
||||
val deprecated: Boolean = false
|
||||
val deprecated: Boolean = false,
|
||||
val securitySchemes: Set<String> = emptySet()
|
||||
)
|
||||
|
@ -3,5 +3,5 @@ package org.leafygreens.kompendium.models.oas
|
||||
// TODO I *think* the only thing I need here is the security https://swagger.io/specification/#components-object
|
||||
data class OpenApiSpecComponents(
|
||||
val schemas: MutableMap<String, OpenApiSpecComponentSchema> = mutableMapOf(),
|
||||
val securitySchemes: MutableMap<String, OpenApiSpecSchema> = mutableMapOf()
|
||||
val securitySchemes: MutableMap<String, OpenApiSpecSchemaSecurity> = mutableMapOf()
|
||||
)
|
||||
|
Reference in New Issue
Block a user