Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
SMILEY4 committed Oct 13, 2024
2 parents 81bb931 + 4f0f0de commit 9a6767e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlin.code.style=official
# project id
projectGroupId=io.github.smiley4
projectArtifactIdBase=ktor-swagger-ui
projectVersion=3.5.0
projectVersion=3.5.1

# publishing information
projectNameBase=Ktor Swagger UI
Expand All @@ -16,10 +16,10 @@ projectDeveloperName=smiley4
projectDeveloperUrl=https://github.com/SMILEY4

# dependency versions
versionKtor=2.3.11
versionKtor=2.3.12
versionSwaggerUI=5.17.11
versionSwaggerParser=2.1.22
versionSchemaKenerator=1.4.1
versionSchemaKenerator=1.4.3
versionKotlinLogging=3.0.5
versionKotest=5.8.0
versionKotlinTest=1.8.21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ import io.ktor.server.application.hooks.MonitoringEvent
import io.ktor.server.application.install
import io.ktor.server.application.plugin
import io.ktor.server.application.pluginOrNull
import io.ktor.server.config.*
import io.ktor.server.routing.Routing
import io.ktor.server.webjars.Webjars
import io.swagger.v3.core.util.Json
import io.swagger.v3.core.util.Json31
import mu.KotlinLogging

/**
Expand Down Expand Up @@ -101,7 +100,7 @@ private fun buildOpenApiSpec(specName: String, pluginConfig: PluginConfigData, r
}
val openApi = builder(pluginConfig, schemaContext, exampleContext).build(routes)
pluginConfig.postBuild?.let { it(openApi, specName) }
Json.pretty(openApi)
Json31.pretty(openApi)
} catch (e: Exception) {
logger.error("Error during openapi-generation", e)
"{}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ class OperationBuilderTest : StringSpec({
mediaType.schema
.also { it.shouldNotBeNull() }
?.also { schema ->
schema.type shouldBe "array"
schema.items.also { item -> item.type shouldBe "string" }
schema.types shouldContainExactlyInAnyOrder setOf("array")
schema.items.also { item -> item.types shouldContainExactlyInAnyOrder setOf("string") }
}
mediaType.example shouldBe null
mediaType.examples shouldBe null
Expand Down Expand Up @@ -348,7 +348,7 @@ class OperationBuilderTest : StringSpec({
?.also { header ->
header.schema
.also { it.shouldNotBeNull() }
?.also { it.type shouldBe "string" }
?.also { it.types shouldContainExactlyInAnyOrder setOf("string") }
}

response.content
Expand All @@ -359,8 +359,8 @@ class OperationBuilderTest : StringSpec({
mediaType.schema
.also { it.shouldNotBeNull() }
?.also { schema ->
schema.type shouldBe "array"
schema.items.also { item -> item.type shouldBe "string" }
schema.types shouldContainExactlyInAnyOrder setOf("array")
schema.items.also { item -> item.types shouldContainExactlyInAnyOrder setOf("string") }
}
mediaType.example shouldBe null
mediaType.examples shouldBe null
Expand Down Expand Up @@ -467,7 +467,7 @@ class OperationBuilderTest : StringSpec({
?.also { mediaType ->
mediaType.schema
.also { it.shouldNotBeNull() }
?.also { it.type shouldBe "string" }
?.also { it.types shouldContainExactlyInAnyOrder setOf("string") }
mediaType.example shouldBe null
mediaType.examples
.also { it shouldHaveSize 1 }
Expand All @@ -491,7 +491,7 @@ class OperationBuilderTest : StringSpec({
?.also { mediaType ->
mediaType.schema
.also { it.shouldNotBeNull() }
?.also { it.type shouldBe "string" }
?.also { it.types shouldContainExactlyInAnyOrder setOf("string") }
mediaType.example shouldBe null
mediaType.examples
.also { it shouldHaveSize 1 }
Expand Down Expand Up @@ -827,7 +827,7 @@ class OperationBuilderTest : StringSpec({
mediaType.schema
.also { it.shouldNotBeNull() }
?.also { schema ->
schema.type shouldBe "array"
schema.types shouldContainExactlyInAnyOrder setOf("array")
schema.items.also { item ->
item.type shouldBe null
item.`$ref` shouldBe "#/components/schemas/io.github.smiley4." +
Expand All @@ -852,7 +852,7 @@ class OperationBuilderTest : StringSpec({
"io.github.smiley4.ktorswaggerui.builder.OperationBuilderTest.Companion.SimpleObject"
)
section["io.github.smiley4.ktorswaggerui.builder.OperationBuilderTest.Companion.SimpleObject"]?.also { schema ->
schema.type shouldBe "object"
schema.types shouldContainExactlyInAnyOrder setOf("object")
schema.properties.keys shouldContainExactlyInAnyOrder listOf("number", "text")
}
}
Expand Down

0 comments on commit 9a6767e

Please sign in to comment.