fix: put info request body nullable
This commit is contained in:
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
## Released
|
## Released
|
||||||
|
|
||||||
|
## [2.3.4] - April 7th, 2022
|
||||||
|
### Changed
|
||||||
|
- Put request body info now nullable
|
||||||
|
|
||||||
## [2.3.3] - April 1st, 2022
|
## [2.3.3] - April 1st, 2022
|
||||||
### Added
|
### Added
|
||||||
- Added tests for Swagger UI module that verify that plugin generates correct responses for Swagger UI WEB resources (tests should detect future incompatible changes in new versions of `org.webjars.swagger-ui`)
|
- Added tests for Swagger UI module that verify that plugin generates correct responses for Swagger UI WEB resources (tests should detect future incompatible changes in new versions of `org.webjars.swagger-ui`)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Kompendium
|
# Kompendium
|
||||||
project.version=2.3.3
|
project.version=2.3.4
|
||||||
# Kotlin
|
# Kotlin
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# Gradle
|
# Gradle
|
||||||
|
@ -6,7 +6,7 @@ import io.bkbn.kompendium.core.metadata.RequestInfo
|
|||||||
import io.bkbn.kompendium.core.metadata.ResponseInfo
|
import io.bkbn.kompendium.core.metadata.ResponseInfo
|
||||||
|
|
||||||
data class PutInfo<TParam, TReq, TResp>(
|
data class PutInfo<TParam, TReq, TResp>(
|
||||||
val requestInfo: RequestInfo<TReq>,
|
val requestInfo: RequestInfo<TReq>?,
|
||||||
override val responseInfo: ResponseInfo<TResp>,
|
override val responseInfo: ResponseInfo<TResp>,
|
||||||
override val summary: String,
|
override val summary: String,
|
||||||
override val description: String? = null,
|
override val description: String? = null,
|
||||||
|
@ -9,11 +9,13 @@ import io.bkbn.kompendium.core.Kompendium
|
|||||||
import io.bkbn.kompendium.core.Notarized.notarizedDelete
|
import io.bkbn.kompendium.core.Notarized.notarizedDelete
|
||||||
import io.bkbn.kompendium.core.Notarized.notarizedGet
|
import io.bkbn.kompendium.core.Notarized.notarizedGet
|
||||||
import io.bkbn.kompendium.core.Notarized.notarizedPost
|
import io.bkbn.kompendium.core.Notarized.notarizedPost
|
||||||
|
import io.bkbn.kompendium.core.Notarized.notarizedPut
|
||||||
import io.bkbn.kompendium.core.metadata.RequestInfo
|
import io.bkbn.kompendium.core.metadata.RequestInfo
|
||||||
import io.bkbn.kompendium.core.metadata.ResponseInfo
|
import io.bkbn.kompendium.core.metadata.ResponseInfo
|
||||||
import io.bkbn.kompendium.core.metadata.method.DeleteInfo
|
import io.bkbn.kompendium.core.metadata.method.DeleteInfo
|
||||||
import io.bkbn.kompendium.core.metadata.method.GetInfo
|
import io.bkbn.kompendium.core.metadata.method.GetInfo
|
||||||
import io.bkbn.kompendium.core.metadata.method.PostInfo
|
import io.bkbn.kompendium.core.metadata.method.PostInfo
|
||||||
|
import io.bkbn.kompendium.core.metadata.method.PutInfo
|
||||||
import io.bkbn.kompendium.core.routes.redoc
|
import io.bkbn.kompendium.core.routes.redoc
|
||||||
import io.bkbn.kompendium.core.routes.swagger
|
import io.bkbn.kompendium.core.routes.swagger
|
||||||
import io.bkbn.kompendium.oas.serialization.KompendiumSerializersModule
|
import io.bkbn.kompendium.oas.serialization.KompendiumSerializersModule
|
||||||
@ -24,6 +26,7 @@ import io.bkbn.kompendium.playground.BasicPlaygroundToC.simpleDeleteRequest
|
|||||||
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simpleGetExample
|
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simpleGetExample
|
||||||
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simpleGetExampleWithParameters
|
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simpleGetExampleWithParameters
|
||||||
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simplePostRequest
|
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simplePostRequest
|
||||||
|
import io.bkbn.kompendium.playground.BasicPlaygroundToC.simplePutInfo
|
||||||
import io.bkbn.kompendium.playground.util.Util
|
import io.bkbn.kompendium.playground.util.Util
|
||||||
import io.ktor.application.Application
|
import io.ktor.application.Application
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
@ -99,6 +102,11 @@ private fun Application.mainModule() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
route("/update") {
|
||||||
|
notarizedPut(simplePutInfo) {
|
||||||
|
call.respond(HttpStatusCode.NoContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +162,18 @@ object BasicPlaygroundToC {
|
|||||||
tags = setOf("Simple")
|
tags = setOf("Simple")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val simplePutInfo = PutInfo<Unit, Unit, BasicResponse>(
|
||||||
|
summary = "Simple, Documented POST Request",
|
||||||
|
description = "Showcases how easy it is to document a post request!",
|
||||||
|
requestInfo = null,
|
||||||
|
responseInfo = ResponseInfo(
|
||||||
|
status = HttpStatusCode.OK,
|
||||||
|
description = "This means everything went as expected!",
|
||||||
|
examples = mapOf("demo" to BasicResponse(c = "So it is true!", null))
|
||||||
|
),
|
||||||
|
tags = setOf("Simple")
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This showcases a DELETE request
|
* This showcases a DELETE request
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user