we buidlin

This commit is contained in:
Ryan
2021-04-11 14:01:27 -04:00
parent 277f3197e4
commit 450dda5387
7 changed files with 11 additions and 31 deletions

View File

@ -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")

View File

@ -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]*'

View File

@ -1,10 +0,0 @@
/*
* This Kotlin source file was generated by the Gradle 'init' task.
*/
package kompendium
class Library {
fun someLibraryMethod(): String {
return "Heya"
}
}

View File

@ -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<OpenApiSpecServer> = emptyList(), // TODO Needs to default to server object with url of `/`
// TODO Needs to default to server object with url of `/`
val servers: List<OpenApiSpecServer> = emptyList(),
val paths: Map<String, OpenApiSpecPathItem> = emptyMap(),
val components: OpenApiSpecComponents? = null,
val security: Map<String, String> = emptyMap(), // todo needs to reference objects in the components -> security scheme 🤔
// todo needs to reference objects in the components -> security scheme 🤔
val security: Map<String, String> = emptyMap(),
val tags: List<OpenApiSpecTag> = emptyList(),
val externalDocs: OpenApiSpecExternalDocumentation? = null
)

View File

@ -8,10 +8,12 @@ data class OpenApiSpecPathItemOperation(
val operationId: String? = null,
val parameters: List<OpenApiSpecReferencable>? = null,
val requestBody: OpenApiSpecReferencable? = null,
val responses: Map<String, OpenApiSpecReferencable>? = null, // TODO How to enforce `default` requirement
// TODO How to enforce `default` requirement 🧐
val responses: Map<String, OpenApiSpecReferencable>? = null,
val callbacks: Map<String, OpenApiSpecReferencable>? = null,
val deprecated: Boolean = false,
val security: List<Map<String, List<String>>>? = 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<Map<String, List<String>>>? = null,
val servers: List<OpenApiSpecServer>? = null,
val `x-codegen-request-body-name`: String? = null
)

View File

@ -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'")
}
}

View File

@ -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")
}
}
}