chore: clean up some bad habits
This commit is contained in:
@ -25,11 +25,11 @@ class DeleteInfo private constructor(
|
||||
|
||||
class Builder : MethodInfo.Builder<DeleteInfo>() {
|
||||
override fun build() = DeleteInfo(
|
||||
response = response!!,
|
||||
response = response ?: error("Response info must be present"),
|
||||
errors = errors,
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -25,11 +25,11 @@ class HeadInfo private constructor(
|
||||
|
||||
class Builder : MethodInfo.Builder<HeadInfo>() {
|
||||
override fun build() = HeadInfo(
|
||||
response = response!!,
|
||||
response = response ?: error("Response info must be present"),
|
||||
errors = errors,
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -25,11 +25,11 @@ class OptionsInfo private constructor(
|
||||
|
||||
class Builder : MethodInfo.Builder<OptionsInfo>() {
|
||||
override fun build() = OptionsInfo(
|
||||
response = response!!,
|
||||
response = response ?: error("Response info must be provided!"),
|
||||
errors = errors,
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be provided!"),
|
||||
description = description ?: error("Description must be provided!"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -26,12 +26,12 @@ class PatchInfo private constructor(
|
||||
|
||||
class Builder : MethodInfoWithRequest.Builder<PatchInfo>() {
|
||||
override fun build() = PatchInfo(
|
||||
request = request!!,
|
||||
request = request ?: error("request info must be present"),
|
||||
errors = errors,
|
||||
response = response!!,
|
||||
response = response ?: error("response info must be present"),
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -26,12 +26,12 @@ class PostInfo private constructor(
|
||||
|
||||
class Builder : MethodInfoWithRequest.Builder<PostInfo>() {
|
||||
override fun build() = PostInfo(
|
||||
request = request!!,
|
||||
request = request ?: error("request info must be present"),
|
||||
errors = errors,
|
||||
response = response!!,
|
||||
response = response ?: error("response info must be present"),
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -26,12 +26,12 @@ class PutInfo private constructor(
|
||||
|
||||
class Builder : MethodInfoWithRequest.Builder<PutInfo>() {
|
||||
override fun build() = PutInfo(
|
||||
request = request!!,
|
||||
request = request ?: error("request info must be present"),
|
||||
errors = errors,
|
||||
response = response!!,
|
||||
response = response ?: error("response info must be present"),
|
||||
tags = tags,
|
||||
summary = summary!!,
|
||||
description = description!!,
|
||||
summary = summary ?: error("Summary must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
externalDocumentation = externalDocumentation,
|
||||
operationId = operationId,
|
||||
deprecated = deprecated,
|
||||
|
@ -37,8 +37,8 @@ class RequestInfo private constructor(
|
||||
}
|
||||
|
||||
fun build() = RequestInfo(
|
||||
requestType = requestType!!,
|
||||
description = description!!,
|
||||
requestType = requestType ?: error("Request type must be present"),
|
||||
description = description ?: error("Description must be present"),
|
||||
examples = examples
|
||||
)
|
||||
}
|
||||
|
@ -55,7 +55,8 @@ object NotarizedRoute {
|
||||
Please make sure that all notarized paths are unique
|
||||
""".trimIndent()
|
||||
}
|
||||
spec.paths[routePath] = pluginConfig.path!!
|
||||
spec.paths[routePath] = pluginConfig.path
|
||||
?: error("This indicates a bug in Kompendium. Please file a GitHub issue!")
|
||||
}
|
||||
|
||||
val spec = application.attributes[KompendiumAttributes.openApiSpec]
|
||||
|
Reference in New Issue
Block a user