diff --git a/build.gradle.kts b/build.gradle.kts index 29d10a159..e5d1c20f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,7 @@ allprojects { repositories { mavenCentral() + maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") } } apply(plugin = "org.jetbrains.kotlin.jvm") diff --git a/detekt.yml b/detekt.yml index 7cd298420..0c6680013 100644 --- a/detekt.yml +++ b/detekt.yml @@ -361,7 +361,7 @@ naming: excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] classPattern: '[A-Z][a-zA-Z0-9]*' ConstructorParameterNaming: - active: true + active: false excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' diff --git a/kompendium/src/main/kotlin/kompendium/Library.kt b/kompendium/src/main/kotlin/kompendium/Library.kt deleted file mode 100644 index 6eefd3560..000000000 --- a/kompendium/src/main/kotlin/kompendium/Library.kt +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This Kotlin source file was generated by the Gradle 'init' task. - */ -package kompendium - -class Library { - fun someLibraryMethod(): String { - return "Heya" - } -} diff --git a/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpec.kt b/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpec.kt index 79762f081..a93cc8a8d 100644 --- a/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpec.kt +++ b/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpec.kt @@ -3,10 +3,12 @@ package org.leafygreens.kompendium.models data class OpenApiSpec( val openapi: String = "3.0.3", val info: OpenApiSpecInfo? = null, - val servers: List = emptyList(), // TODO Needs to default to server object with url of `/` + // TODO Needs to default to server object with url of `/` + val servers: List = emptyList(), val paths: Map = emptyMap(), val components: OpenApiSpecComponents? = null, - val security: Map = emptyMap(), // todo needs to reference objects in the components -> security scheme 🤔 + // todo needs to reference objects in the components -> security scheme 🤔 + val security: Map = emptyMap(), val tags: List = emptyList(), val externalDocs: OpenApiSpecExternalDocumentation? = null ) diff --git a/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpecPathItemOperation.kt b/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpecPathItemOperation.kt index 8c6af4193..dfb04aad5 100644 --- a/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpecPathItemOperation.kt +++ b/kompendium/src/main/kotlin/org/leafygreens/kompendium/models/OpenApiSpecPathItemOperation.kt @@ -8,10 +8,12 @@ data class OpenApiSpecPathItemOperation( val operationId: String? = null, val parameters: List? = null, val requestBody: OpenApiSpecReferencable? = null, - val responses: Map? = null, // TODO How to enforce `default` requirement + // TODO How to enforce `default` requirement 🧐 + val responses: Map? = null, val callbacks: Map? = null, val deprecated: Boolean = false, - val security: List>>? = null, // todo big yikes... also needs to reference objects in the security scheme 🤔 + // todo big yikes... also needs to reference objects in the security scheme 🤔 + val security: List>>? = null, val servers: List? = null, val `x-codegen-request-body-name`: String? = null ) diff --git a/kompendium/src/test/kotlin/kompendium/LibraryTest.kt b/kompendium/src/test/kotlin/kompendium/LibraryTest.kt deleted file mode 100644 index 0aff026b5..000000000 --- a/kompendium/src/test/kotlin/kompendium/LibraryTest.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Kotlin source file was generated by the Gradle 'init' task. - */ -package kompendium - -import kotlin.test.Test -import kotlin.test.assertEquals - -class LibraryTest { - @Test fun testSomeLibraryMethod() { - val classUnderTest = Library() - assertEquals(classUnderTest.someLibraryMethod(), "Heya", "someLibraryMethod should return 'true'") - } -} diff --git a/playground/src/main/kotlin/org/leafygreens/kompendium/playground/Main.kt b/playground/src/main/kotlin/org/leafygreens/kompendium/playground/Main.kt index 66128ac96..733a8cfd7 100644 --- a/playground/src/main/kotlin/org/leafygreens/kompendium/playground/Main.kt +++ b/playground/src/main/kotlin/org/leafygreens/kompendium/playground/Main.kt @@ -8,7 +8,6 @@ import io.ktor.routing.route import io.ktor.routing.routing import io.ktor.server.engine.embeddedServer import io.ktor.server.netty.Netty -import kompendium.Library fun main() { embeddedServer( @@ -22,7 +21,7 @@ fun Application.mainModule() { routing { route("/") { get { - call.respondText(Library().someLibraryMethod()) + call.respondText("hi") } } }