encode oas to json internally (#69)
This commit is contained in:
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.3.0] - June 4th, 2021
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Explicitly encode JSON object by default
|
||||||
|
|
||||||
## [1.2.3] - June 3rd, 2021
|
## [1.2.3] - June 3rd, 2021
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -104,13 +104,8 @@ suggestions on better implementations are welcome 🤠
|
|||||||
|
|
||||||
### Serialization
|
### Serialization
|
||||||
|
|
||||||
Kompendium is serialization agnostic, meaning that there is no serializer library included out of the box. This grants
|
Under the hood, Kompendium uses Jackson to serialize the final api spec. However, this implementation detail
|
||||||
developer flexibility, at the cost of some potential extra legwork. The example in the playground shows Jackson working
|
does not leak to the actual API, meaning that users are free to choose the serialization library of their choice.
|
||||||
pretty much out of the box, but more explicit serializers like Moshi and Kotlinx Serialization will require registering
|
|
||||||
custom serializers in order to encode the api spec payload.
|
|
||||||
|
|
||||||
This overhead is annoying, and will hopefully be reduced in the future. Should you have ideas on how to tackle this
|
|
||||||
issue, please head on over to the discussion on this topic [here](https://github.com/bkbnio/kompendium/discussions/64)
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import com.adarshr.gradle.testlogger.theme.ThemeType
|
|
||||||
import com.adarshr.gradle.testlogger.TestLoggerExtension
|
import com.adarshr.gradle.testlogger.TestLoggerExtension
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import com.adarshr.gradle.testlogger.theme.ThemeType
|
||||||
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
|
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.5.0" apply false
|
id("org.jetbrains.kotlin.jvm") version "1.5.0" apply false
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Kompendium
|
# Kompendium
|
||||||
project.version=1.2.3
|
project.version=1.3.0
|
||||||
# Kotlin
|
# Kotlin
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# Gradle
|
# Gradle
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlin = "1.4.32"
|
kotlin = "1.4.32"
|
||||||
ktor = "1.5.3"
|
ktor = "1.5.3"
|
||||||
|
kotlinx-serialization = "1.2.1"
|
||||||
|
jackson-kotlin = "2.12.0"
|
||||||
slf4j = "1.7.30"
|
slf4j = "1.7.30"
|
||||||
logback = "1.2.3"
|
logback = "1.2.3"
|
||||||
swagger-ui = "3.47.1"
|
swagger-ui = "3.47.1"
|
||||||
@ -10,11 +12,17 @@ swagger-ui = "3.47.1"
|
|||||||
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
|
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
|
||||||
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" }
|
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" }
|
||||||
ktor-jackson = { group = "io.ktor", name = "ktor-jackson", version.ref = "ktor" }
|
ktor-jackson = { group = "io.ktor", name = "ktor-jackson", version.ref = "ktor" }
|
||||||
|
ktor-serialization = { group = "io.ktor", name = "ktor-serialization", version.ref = "ktor" }
|
||||||
ktor-html-builder = { group = "io.ktor", name = "ktor-html-builder", version.ref = "ktor" }
|
ktor-html-builder = { group = "io.ktor", name = "ktor-html-builder", version.ref = "ktor" }
|
||||||
ktor-auth-lib = { group = "io.ktor", name = "ktor-auth", version.ref = "ktor" }
|
ktor-auth-lib = { group = "io.ktor", name = "ktor-auth", version.ref = "ktor" }
|
||||||
ktor-auth-jwt = { group = "io.ktor", name = "ktor-auth-jwt", version.ref = "ktor" }
|
ktor-auth-jwt = { group = "io.ktor", name = "ktor-auth-jwt", version.ref = "ktor" }
|
||||||
ktor-webjars = { group = "io.ktor", name = "ktor-webjars", version.ref = "ktor" }
|
ktor-webjars = { group = "io.ktor", name = "ktor-webjars", version.ref = "ktor" }
|
||||||
|
|
||||||
|
# Serialization
|
||||||
|
jackson-module-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version.ref = "jackson-kotlin" }
|
||||||
|
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
|
||||||
|
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
||||||
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
||||||
@ -23,6 +31,9 @@ logback-core = { group = "ch.qos.logback", name = "logback-core", version.ref =
|
|||||||
# webjars
|
# webjars
|
||||||
webjars-swagger-ui = { group = "org.webjars", name = "swagger-ui", version.ref = "swagger-ui" }
|
webjars-swagger-ui = { group = "org.webjars", name = "swagger-ui", version.ref = "swagger-ui" }
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
ktor = ["ktor-server-core", "ktor-server-netty", "ktor-html-builder"]
|
ktor = ["ktor-server-core", "ktor-server-netty", "ktor-html-builder"]
|
||||||
ktorAuth = ["ktor-auth-lib", "ktor-auth-jwt"]
|
ktorAuth = ["ktor-auth-lib", "ktor-auth-jwt"]
|
||||||
|
@ -14,8 +14,8 @@ dependencies {
|
|||||||
testImplementation(libs.ktor.jackson)
|
testImplementation(libs.ktor.jackson)
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
||||||
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.0")
|
testImplementation(libs.jackson.module.kotlin)
|
||||||
testImplementation("io.ktor:ktor-server-test-host:1.5.3")
|
testImplementation(libs.ktor.server.test.host)
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -51,16 +51,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -51,16 +51,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -51,16 +51,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -51,16 +51,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -52,16 +52,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
|
@ -7,12 +7,14 @@ plugins {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||||
|
implementation(libs.jackson.module.kotlin)
|
||||||
implementation(libs.bundles.ktor)
|
implementation(libs.bundles.ktor)
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
||||||
|
testImplementation(libs.ktor.serialization)
|
||||||
|
testImplementation(libs.kotlinx.serialization.json)
|
||||||
testImplementation(libs.ktor.jackson)
|
testImplementation(libs.ktor.jackson)
|
||||||
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.0")
|
testImplementation(libs.ktor.server.test.host)
|
||||||
testImplementation("io.ktor:ktor-server-test-host:1.5.3")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
@ -1,20 +1,26 @@
|
|||||||
package io.bkbn.kompendium.routes
|
package io.bkbn.kompendium.routes
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature
|
||||||
|
import io.bkbn.kompendium.models.oas.OpenApiSpec
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.response.respond
|
import io.ktor.response.respondText
|
||||||
import io.ktor.routing.Routing
|
import io.ktor.routing.Routing
|
||||||
import io.ktor.routing.get
|
import io.ktor.routing.get
|
||||||
import io.ktor.routing.route
|
import io.ktor.routing.route
|
||||||
import io.bkbn.kompendium.models.oas.OpenApiSpec
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an out-of-the-box route to return the generated [OpenApiSpec]
|
* Provides an out-of-the-box route to return the generated [OpenApiSpec]
|
||||||
* @param oas spec that is returned
|
* @param oas spec that is returned
|
||||||
*/
|
*/
|
||||||
fun Routing.openApi(oas: OpenApiSpec) {
|
fun Routing.openApi(oas: OpenApiSpec) {
|
||||||
|
val om = ObjectMapper()
|
||||||
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
|
.enable(SerializationFeature.INDENT_OUTPUT)
|
||||||
route("/openapi.json") {
|
route("/openapi.json") {
|
||||||
get {
|
get {
|
||||||
call.respond(oas)
|
call.respondText { om.writeValueAsString(oas) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,11 @@ import io.bkbn.kompendium.routes.openApi
|
|||||||
import io.bkbn.kompendium.routes.redoc
|
import io.bkbn.kompendium.routes.redoc
|
||||||
import io.bkbn.kompendium.util.TestHelpers.getFileSnapshot
|
import io.bkbn.kompendium.util.TestHelpers.getFileSnapshot
|
||||||
import io.bkbn.kompendium.util.complexType
|
import io.bkbn.kompendium.util.complexType
|
||||||
import io.bkbn.kompendium.util.configModule
|
import io.bkbn.kompendium.util.jacksonConfigModule
|
||||||
import io.bkbn.kompendium.util.emptyGet
|
import io.bkbn.kompendium.util.emptyGet
|
||||||
import io.bkbn.kompendium.util.genericPolymorphicResponse
|
import io.bkbn.kompendium.util.genericPolymorphicResponse
|
||||||
import io.bkbn.kompendium.util.genericPolymorphicResponseMultipleImpls
|
import io.bkbn.kompendium.util.genericPolymorphicResponseMultipleImpls
|
||||||
|
import io.bkbn.kompendium.util.kotlinxConfigModule
|
||||||
import io.bkbn.kompendium.util.nestedUnderRootModule
|
import io.bkbn.kompendium.util.nestedUnderRootModule
|
||||||
import io.bkbn.kompendium.util.nonRequiredParamsGet
|
import io.bkbn.kompendium.util.nonRequiredParamsGet
|
||||||
import io.bkbn.kompendium.util.notarizedDeleteModule
|
import io.bkbn.kompendium.util.notarizedDeleteModule
|
||||||
@ -57,7 +58,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized Get records all expected information`() {
|
fun `Notarized Get records all expected information`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedGetModule()
|
notarizedGetModule()
|
||||||
}) {
|
}) {
|
||||||
@ -73,7 +74,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized Get does not interrupt the pipeline`() {
|
fun `Notarized Get does not interrupt the pipeline`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedGetModule()
|
notarizedGetModule()
|
||||||
}) {
|
}) {
|
||||||
@ -89,7 +90,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized Post records all expected information`() {
|
fun `Notarized Post records all expected information`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedPostModule()
|
notarizedPostModule()
|
||||||
}) {
|
}) {
|
||||||
@ -105,7 +106,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized post does not interrupt the pipeline`() {
|
fun `Notarized post does not interrupt the pipeline`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedPostModule()
|
notarizedPostModule()
|
||||||
}) {
|
}) {
|
||||||
@ -121,7 +122,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized Put records all expected information`() {
|
fun `Notarized Put records all expected information`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedPutModule()
|
notarizedPutModule()
|
||||||
}) {
|
}) {
|
||||||
@ -138,7 +139,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized put does not interrupt the pipeline`() {
|
fun `Notarized put does not interrupt the pipeline`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedPutModule()
|
notarizedPutModule()
|
||||||
}) {
|
}) {
|
||||||
@ -154,7 +155,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized delete records all expected information`() {
|
fun `Notarized delete records all expected information`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedDeleteModule()
|
notarizedDeleteModule()
|
||||||
}) {
|
}) {
|
||||||
@ -170,7 +171,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Notarized delete does not interrupt the pipeline`() {
|
fun `Notarized delete does not interrupt the pipeline`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedDeleteModule()
|
notarizedDeleteModule()
|
||||||
}) {
|
}) {
|
||||||
@ -185,7 +186,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Path parser stores the expected path`() {
|
fun `Path parser stores the expected path`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
pathParsingTestModule()
|
pathParsingTestModule()
|
||||||
}) {
|
}) {
|
||||||
@ -201,7 +202,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize the root route`() {
|
fun `Can notarize the root route`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
rootModule()
|
rootModule()
|
||||||
}) {
|
}) {
|
||||||
@ -217,7 +218,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can call the root route`() {
|
fun `Can call the root route`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
rootModule()
|
rootModule()
|
||||||
}) {
|
}) {
|
||||||
@ -233,7 +234,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Nested under root module does not append trailing slash`() {
|
fun `Nested under root module does not append trailing slash`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
nestedUnderRootModule()
|
nestedUnderRootModule()
|
||||||
}) {
|
}) {
|
||||||
@ -249,7 +250,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize a trailing slash route`() {
|
fun `Can notarize a trailing slash route`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
trailingSlash()
|
trailingSlash()
|
||||||
}) {
|
}) {
|
||||||
@ -265,7 +266,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can call a trailing slash route`() {
|
fun `Can call a trailing slash route`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
trailingSlash()
|
trailingSlash()
|
||||||
}) {
|
}) {
|
||||||
@ -281,7 +282,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize a complex type`() {
|
fun `Can notarize a complex type`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
complexType()
|
complexType()
|
||||||
}) {
|
}) {
|
||||||
@ -297,7 +298,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize primitives`() {
|
fun `Can notarize primitives`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
primitives()
|
primitives()
|
||||||
}) {
|
}) {
|
||||||
@ -313,7 +314,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize a top level list response`() {
|
fun `Can notarize a top level list response`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
returnsList()
|
returnsList()
|
||||||
}) {
|
}) {
|
||||||
@ -329,7 +330,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize route with no request params and no response body`() {
|
fun `Can notarize route with no request params and no response body`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
emptyGet()
|
emptyGet()
|
||||||
}) {
|
}) {
|
||||||
@ -345,7 +346,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can notarize route with non-required params`() {
|
fun `Can notarize route with non-required params`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
nonRequiredParamsGet()
|
nonRequiredParamsGet()
|
||||||
}) {
|
}) {
|
||||||
@ -361,7 +362,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Generates the expected redoc`() {
|
fun `Generates the expected redoc`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
returnsList()
|
returnsList()
|
||||||
}) {
|
}) {
|
||||||
@ -378,7 +379,7 @@ internal class KompendiumTest {
|
|||||||
fun `Generates additional responses when passed a throwable`() {
|
fun `Generates additional responses when passed a throwable`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
statusPageModule()
|
statusPageModule()
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedGetWithNotarizedException()
|
notarizedGetWithNotarizedException()
|
||||||
}) {
|
}) {
|
||||||
@ -395,7 +396,7 @@ internal class KompendiumTest {
|
|||||||
fun `Generates additional responses when passed multiple throwables`() {
|
fun `Generates additional responses when passed multiple throwables`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
statusPageMultiExceptions()
|
statusPageMultiExceptions()
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
notarizedGetWithMultipleThrowables()
|
notarizedGetWithMultipleThrowables()
|
||||||
}) {
|
}) {
|
||||||
@ -411,7 +412,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can generate example response and request bodies`() {
|
fun `Can generate example response and request bodies`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
withExamples()
|
withExamples()
|
||||||
}) {
|
}) {
|
||||||
@ -427,7 +428,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can generate a default parameter value`() {
|
fun `Can generate a default parameter value`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
withDefaultParameter()
|
withDefaultParameter()
|
||||||
}) {
|
}) {
|
||||||
@ -443,7 +444,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can generate a polymorphic response type`() {
|
fun `Can generate a polymorphic response type`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
polymorphicResponse()
|
polymorphicResponse()
|
||||||
}) {
|
}) {
|
||||||
@ -459,7 +460,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can generate a response type with a generic type`() {
|
fun `Can generate a response type with a generic type`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
simpleGenericResponse()
|
simpleGenericResponse()
|
||||||
}) {
|
}) {
|
||||||
@ -475,7 +476,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Can generate a polymorphic response type with generics`() {
|
fun `Can generate a polymorphic response type with generics`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
jacksonConfigModule()
|
||||||
docs()
|
docs()
|
||||||
genericPolymorphicResponse()
|
genericPolymorphicResponse()
|
||||||
}) {
|
}) {
|
||||||
@ -491,7 +492,7 @@ internal class KompendiumTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `Absolute Psycho Inheritance Test`() {
|
fun `Absolute Psycho Inheritance Test`() {
|
||||||
withTestApplication({
|
withTestApplication({
|
||||||
configModule()
|
kotlinxConfigModule()
|
||||||
docs()
|
docs()
|
||||||
genericPolymorphicResponseMultipleImpls()
|
genericPolymorphicResponseMultipleImpls()
|
||||||
}) {
|
}) {
|
||||||
|
@ -21,8 +21,9 @@ import io.ktor.response.respond
|
|||||||
import io.ktor.response.respondText
|
import io.ktor.response.respondText
|
||||||
import io.ktor.routing.route
|
import io.ktor.routing.route
|
||||||
import io.ktor.routing.routing
|
import io.ktor.routing.routing
|
||||||
|
import io.ktor.serialization.json
|
||||||
|
|
||||||
fun Application.configModule() {
|
fun Application.jacksonConfigModule() {
|
||||||
install(ContentNegotiation) {
|
install(ContentNegotiation) {
|
||||||
jackson {
|
jackson {
|
||||||
enable(SerializationFeature.INDENT_OUTPUT)
|
enable(SerializationFeature.INDENT_OUTPUT)
|
||||||
@ -31,6 +32,12 @@ fun Application.configModule() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Application.kotlinxConfigModule() {
|
||||||
|
install(ContentNegotiation) {
|
||||||
|
json()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun Application.statusPageModule() {
|
fun Application.statusPageModule() {
|
||||||
install(StatusPages) {
|
install(StatusPages) {
|
||||||
notarizedException<Exception, ExceptionResponse>(
|
notarizedException<Exception, ExceptionResponse>(
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -62,24 +62,25 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"SimpleEnum" : {
|
"SimpleEnum" : {
|
||||||
"enum" : [ "ONE", "TWO" ],
|
"type" : "string",
|
||||||
"type" : "string"
|
"enum" : [ "ONE", "TWO" ]
|
||||||
},
|
},
|
||||||
"CrazyItem" : {
|
"CrazyItem" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"enumeration" : {
|
"enumeration" : {
|
||||||
"$ref" : "#/components/schemas/SimpleEnum"
|
"$ref" : "#/components/schemas/SimpleEnum"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Map-String-CrazyItem" : {
|
"Map-String-CrazyItem" : {
|
||||||
|
"type" : "object",
|
||||||
"additionalProperties" : {
|
"additionalProperties" : {
|
||||||
"$ref" : "#/components/schemas/CrazyItem"
|
"$ref" : "#/components/schemas/CrazyItem"
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"NestedComplexItem" : {
|
"NestedComplexItem" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"alias" : {
|
"alias" : {
|
||||||
"$ref" : "#/components/schemas/Map-String-CrazyItem"
|
"$ref" : "#/components/schemas/Map-String-CrazyItem"
|
||||||
@ -87,16 +88,16 @@
|
|||||||
"name" : {
|
"name" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"List-NestedComplexItem" : {
|
"List-NestedComplexItem" : {
|
||||||
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
"$ref" : "#/components/schemas/NestedComplexItem"
|
"$ref" : "#/components/schemas/NestedComplexItem"
|
||||||
},
|
}
|
||||||
"type" : "array"
|
|
||||||
},
|
},
|
||||||
"ComplexRequest" : {
|
"ComplexRequest" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"amazingField" : {
|
"amazingField" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -107,14 +108,14 @@
|
|||||||
"tables" : {
|
"tables" : {
|
||||||
"$ref" : "#/components/schemas/List-NestedComplexItem"
|
"$ref" : "#/components/schemas/List-NestedComplexItem"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"TestCreatedResponse" : {
|
"TestCreatedResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -122,8 +123,7 @@
|
|||||||
"id" : {
|
"id" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -80,22 +80,23 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestNested" : {
|
"TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"nesty" : {
|
"nesty" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Gibbity-TestNested" : {
|
"Gibbity-TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"a" : {
|
"a" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Bibbity-TestNested" : {
|
"Bibbity-TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"b" : {
|
"b" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -103,22 +104,22 @@
|
|||||||
"f" : {
|
"f" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"SimpleGibbit" : {
|
"SimpleGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"a" : {
|
"a" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"ComplexGibbit" : {
|
"ComplexGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"b" : {
|
"b" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -126,10 +127,10 @@
|
|||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Gibbity-FlibbityGibbit" : {
|
"Gibbity-FlibbityGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"a" : {
|
"a" : {
|
||||||
"anyOf" : [ {
|
"anyOf" : [ {
|
||||||
@ -138,10 +139,10 @@
|
|||||||
"$ref" : "#/components/schemas/ComplexGibbit"
|
"$ref" : "#/components/schemas/ComplexGibbit"
|
||||||
} ]
|
} ]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Bibbity-FlibbityGibbit" : {
|
"Bibbity-FlibbityGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"b" : {
|
"b" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -153,8 +154,7 @@
|
|||||||
"$ref" : "#/components/schemas/ComplexGibbit"
|
"$ref" : "#/components/schemas/ComplexGibbit"
|
||||||
} ]
|
} ]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -86,31 +86,32 @@
|
|||||||
"components" : {
|
"components" : {
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Long" : {
|
"Long" : {
|
||||||
"format" : "int64",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int64"
|
||||||
},
|
},
|
||||||
"List-Long" : {
|
"List-Long" : {
|
||||||
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
"$ref" : "#/components/schemas/Long"
|
"$ref" : "#/components/schemas/Long"
|
||||||
},
|
}
|
||||||
"type" : "array"
|
|
||||||
},
|
},
|
||||||
"Double" : {
|
"Double" : {
|
||||||
"format" : "double",
|
"type" : "number",
|
||||||
"type" : "number"
|
"format" : "double"
|
||||||
},
|
},
|
||||||
"String" : {
|
"String" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestNested" : {
|
"TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"nesty" : {
|
"nesty" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestRequest" : {
|
"TestRequest" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"aaa" : {
|
"aaa" : {
|
||||||
"$ref" : "#/components/schemas/List-Long"
|
"$ref" : "#/components/schemas/List-Long"
|
||||||
@ -121,16 +122,15 @@
|
|||||||
"fieldName" : {
|
"fieldName" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -51,10 +51,11 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"TestGeneric-Int" : {
|
"TestGeneric-Int" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"messy" : {
|
"messy" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -62,8 +63,7 @@
|
|||||||
"potato" : {
|
"potato" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,16 +68,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -61,8 +61,8 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,16 +68,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -78,24 +78,24 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"ExceptionResponse" : {
|
"ExceptionResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"message" : {
|
"message" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -81,24 +81,24 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"ExceptionResponse" : {
|
"ExceptionResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"message" : {
|
"message" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -76,31 +76,32 @@
|
|||||||
"components" : {
|
"components" : {
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Long" : {
|
"Long" : {
|
||||||
"format" : "int64",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int64"
|
||||||
},
|
},
|
||||||
"List-Long" : {
|
"List-Long" : {
|
||||||
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
"$ref" : "#/components/schemas/Long"
|
"$ref" : "#/components/schemas/Long"
|
||||||
},
|
}
|
||||||
"type" : "array"
|
|
||||||
},
|
},
|
||||||
"Double" : {
|
"Double" : {
|
||||||
"format" : "double",
|
"type" : "number",
|
||||||
"type" : "number"
|
"format" : "double"
|
||||||
},
|
},
|
||||||
"String" : {
|
"String" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestNested" : {
|
"TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"nesty" : {
|
"nesty" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestRequest" : {
|
"TestRequest" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"aaa" : {
|
"aaa" : {
|
||||||
"$ref" : "#/components/schemas/List-Long"
|
"$ref" : "#/components/schemas/List-Long"
|
||||||
@ -111,14 +112,14 @@
|
|||||||
"fieldName" : {
|
"fieldName" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"TestCreatedResponse" : {
|
"TestCreatedResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -126,8 +127,7 @@
|
|||||||
"id" : {
|
"id" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -59,8 +59,8 @@
|
|||||||
"components" : {
|
"components" : {
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"Boolean" : {
|
"Boolean" : {
|
||||||
"type" : "boolean"
|
"type" : "boolean"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -76,31 +76,32 @@
|
|||||||
"components" : {
|
"components" : {
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Long" : {
|
"Long" : {
|
||||||
"format" : "int64",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int64"
|
||||||
},
|
},
|
||||||
"List-Long" : {
|
"List-Long" : {
|
||||||
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
"$ref" : "#/components/schemas/Long"
|
"$ref" : "#/components/schemas/Long"
|
||||||
},
|
}
|
||||||
"type" : "array"
|
|
||||||
},
|
},
|
||||||
"Double" : {
|
"Double" : {
|
||||||
"format" : "double",
|
"type" : "number",
|
||||||
"type" : "number"
|
"format" : "double"
|
||||||
},
|
},
|
||||||
"String" : {
|
"String" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestNested" : {
|
"TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"nesty" : {
|
"nesty" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"TestRequest" : {
|
"TestRequest" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"aaa" : {
|
"aaa" : {
|
||||||
"$ref" : "#/components/schemas/List-Long"
|
"$ref" : "#/components/schemas/List-Long"
|
||||||
@ -111,14 +112,14 @@
|
|||||||
"fieldName" : {
|
"fieldName" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"TestCreatedResponse" : {
|
"TestCreatedResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -126,8 +127,7 @@
|
|||||||
"id" : {
|
"id" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,16 +68,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -55,18 +55,19 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"SimpleGibbit" : {
|
"SimpleGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"a" : {
|
"a" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"ComplexGibbit" : {
|
"ComplexGibbit" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"b" : {
|
"b" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -74,8 +75,7 @@
|
|||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/Int"
|
"$ref" : "#/components/schemas/Int"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -55,22 +55,23 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestNested" : {
|
"TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"nesty" : {
|
"nesty" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Gibbity-TestNested" : {
|
"Gibbity-TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"a" : {
|
"a" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Bibbity-TestNested" : {
|
"Bibbity-TestNested" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"b" : {
|
"b" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
@ -78,8 +79,7 @@
|
|||||||
"f" : {
|
"f" : {
|
||||||
"$ref" : "#/components/schemas/TestNested"
|
"$ref" : "#/components/schemas/TestNested"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -32,9 +32,9 @@
|
|||||||
"name" : "a",
|
"name" : "a",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"default" : 100,
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"default" : 100
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -65,16 +65,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"Boolean" : {
|
"Boolean" : {
|
||||||
"type" : "boolean"
|
"type" : "boolean"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,22 +68,22 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"List-TestResponse" : {
|
"List-TestResponse" : {
|
||||||
|
"type" : "array",
|
||||||
"items" : {
|
"items" : {
|
||||||
"$ref" : "#/components/schemas/TestResponse"
|
"$ref" : "#/components/schemas/TestResponse"
|
||||||
},
|
}
|
||||||
"type" : "array"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,16 +68,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"title" : "Test API",
|
"title" : "Test API",
|
||||||
"version" : "1.33.7",
|
"version" : "1.33.7",
|
||||||
"description" : "An amazing, fully-ish \uD83D\uDE09 generated API spec",
|
"description" : "An amazing, fully-ish 😉 generated API spec",
|
||||||
"termsOfService" : "https://example.com",
|
"termsOfService" : "https://example.com",
|
||||||
"contact" : {
|
"contact" : {
|
||||||
"name" : "Homer Simpson",
|
"name" : "Homer Simpson",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"name" : "aa",
|
"name" : "aa",
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
},
|
},
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"deprecated" : false
|
"deprecated" : false
|
||||||
@ -68,16 +68,16 @@
|
|||||||
"type" : "string"
|
"type" : "string"
|
||||||
},
|
},
|
||||||
"TestResponse" : {
|
"TestResponse" : {
|
||||||
|
"type" : "object",
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"c" : {
|
"c" : {
|
||||||
"$ref" : "#/components/schemas/String"
|
"$ref" : "#/components/schemas/String"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"type" : "object"
|
|
||||||
},
|
},
|
||||||
"Int" : {
|
"Int" : {
|
||||||
"format" : "int32",
|
"type" : "integer",
|
||||||
"type" : "integer"
|
"format" : "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : { }
|
"securitySchemes" : { }
|
||||||
|
@ -13,6 +13,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation(libs.bundles.ktor)
|
implementation(libs.bundles.ktor)
|
||||||
implementation(libs.ktor.jackson)
|
implementation(libs.ktor.jackson)
|
||||||
|
implementation(libs.kotlinx.serialization.json)
|
||||||
|
implementation(libs.ktor.serialization)
|
||||||
implementation(libs.bundles.ktorAuth)
|
implementation(libs.bundles.ktorAuth)
|
||||||
implementation(libs.bundles.logging)
|
implementation(libs.bundles.logging)
|
||||||
|
|
||||||
|
@ -1,24 +1,5 @@
|
|||||||
package io.bkbn.kompendium.playground
|
package io.bkbn.kompendium.playground
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature
|
|
||||||
import io.ktor.application.Application
|
|
||||||
import io.ktor.application.call
|
|
||||||
import io.ktor.application.install
|
|
||||||
import io.ktor.auth.Authentication
|
|
||||||
import io.ktor.auth.UserIdPrincipal
|
|
||||||
import io.ktor.auth.authenticate
|
|
||||||
import io.ktor.features.ContentNegotiation
|
|
||||||
import io.ktor.features.StatusPages
|
|
||||||
import io.ktor.http.HttpStatusCode
|
|
||||||
import io.ktor.jackson.jackson
|
|
||||||
import io.ktor.response.respond
|
|
||||||
import io.ktor.response.respondText
|
|
||||||
import io.ktor.routing.route
|
|
||||||
import io.ktor.routing.routing
|
|
||||||
import io.ktor.server.engine.embeddedServer
|
|
||||||
import io.ktor.server.netty.Netty
|
|
||||||
import io.ktor.webjars.Webjars
|
|
||||||
import io.bkbn.kompendium.Notarized.notarizedDelete
|
import io.bkbn.kompendium.Notarized.notarizedDelete
|
||||||
import io.bkbn.kompendium.Notarized.notarizedException
|
import io.bkbn.kompendium.Notarized.notarizedException
|
||||||
import io.bkbn.kompendium.Notarized.notarizedGet
|
import io.bkbn.kompendium.Notarized.notarizedGet
|
||||||
@ -38,6 +19,23 @@ import io.bkbn.kompendium.playground.PlaygroundToC.testSinglePutInfo
|
|||||||
import io.bkbn.kompendium.routes.openApi
|
import io.bkbn.kompendium.routes.openApi
|
||||||
import io.bkbn.kompendium.routes.redoc
|
import io.bkbn.kompendium.routes.redoc
|
||||||
import io.bkbn.kompendium.swagger.swaggerUI
|
import io.bkbn.kompendium.swagger.swaggerUI
|
||||||
|
import io.ktor.application.Application
|
||||||
|
import io.ktor.application.call
|
||||||
|
import io.ktor.application.install
|
||||||
|
import io.ktor.auth.Authentication
|
||||||
|
import io.ktor.auth.UserIdPrincipal
|
||||||
|
import io.ktor.auth.authenticate
|
||||||
|
import io.ktor.features.ContentNegotiation
|
||||||
|
import io.ktor.features.StatusPages
|
||||||
|
import io.ktor.http.HttpStatusCode
|
||||||
|
import io.ktor.response.respond
|
||||||
|
import io.ktor.response.respondText
|
||||||
|
import io.ktor.routing.route
|
||||||
|
import io.ktor.routing.routing
|
||||||
|
import io.ktor.serialization.json
|
||||||
|
import io.ktor.server.engine.embeddedServer
|
||||||
|
import io.ktor.server.netty.Netty
|
||||||
|
import io.ktor.webjars.Webjars
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
embeddedServer(
|
embeddedServer(
|
||||||
@ -52,10 +50,7 @@ var featuresInstalled = false
|
|||||||
fun Application.configModule() {
|
fun Application.configModule() {
|
||||||
if (!featuresInstalled) {
|
if (!featuresInstalled) {
|
||||||
install(ContentNegotiation) {
|
install(ContentNegotiation) {
|
||||||
jackson {
|
json()
|
||||||
enable(SerializationFeature.INDENT_OUTPUT)
|
|
||||||
setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
install(Authentication) {
|
install(Authentication) {
|
||||||
notarizedBasic("basic") {
|
notarizedBasic("basic") {
|
||||||
|
@ -12,8 +12,8 @@ dependencies {
|
|||||||
implementation(libs.webjars.swagger.ui)
|
implementation(libs.webjars.swagger.ui)
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
||||||
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.0")
|
testImplementation(libs.jackson.module.kotlin)
|
||||||
testImplementation("io.ktor:ktor-server-test-host:1.5.3")
|
testImplementation(libs.ktor.server.test.host)
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
Reference in New Issue
Block a user