we buidlin
This commit is contained in:
@ -16,6 +16,7 @@ allprojects {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") }
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||||
|
@ -361,7 +361,7 @@ naming:
|
|||||||
excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
classPattern: '[A-Z][a-zA-Z0-9]*'
|
classPattern: '[A-Z][a-zA-Z0-9]*'
|
||||||
ConstructorParameterNaming:
|
ConstructorParameterNaming:
|
||||||
active: true
|
active: false
|
||||||
excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/testIntegration/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
parameterPattern: '[a-z][A-Za-z0-9]*'
|
parameterPattern: '[a-z][A-Za-z0-9]*'
|
||||||
privateParameterPattern: '[a-z][A-Za-z0-9]*'
|
privateParameterPattern: '[a-z][A-Za-z0-9]*'
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
* This Kotlin source file was generated by the Gradle 'init' task.
|
|
||||||
*/
|
|
||||||
package kompendium
|
|
||||||
|
|
||||||
class Library {
|
|
||||||
fun someLibraryMethod(): String {
|
|
||||||
return "Heya"
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,10 +3,12 @@ package org.leafygreens.kompendium.models
|
|||||||
data class OpenApiSpec(
|
data class OpenApiSpec(
|
||||||
val openapi: String = "3.0.3",
|
val openapi: String = "3.0.3",
|
||||||
val info: OpenApiSpecInfo? = null,
|
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 paths: Map<String, OpenApiSpecPathItem> = emptyMap(),
|
||||||
val components: OpenApiSpecComponents? = null,
|
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 tags: List<OpenApiSpecTag> = emptyList(),
|
||||||
val externalDocs: OpenApiSpecExternalDocumentation? = null
|
val externalDocs: OpenApiSpecExternalDocumentation? = null
|
||||||
)
|
)
|
||||||
|
@ -8,10 +8,12 @@ data class OpenApiSpecPathItemOperation(
|
|||||||
val operationId: String? = null,
|
val operationId: String? = null,
|
||||||
val parameters: List<OpenApiSpecReferencable>? = null,
|
val parameters: List<OpenApiSpecReferencable>? = null,
|
||||||
val requestBody: 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 callbacks: Map<String, OpenApiSpecReferencable>? = null,
|
||||||
val deprecated: Boolean = false,
|
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 servers: List<OpenApiSpecServer>? = null,
|
||||||
val `x-codegen-request-body-name`: String? = null
|
val `x-codegen-request-body-name`: String? = 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'")
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ import io.ktor.routing.route
|
|||||||
import io.ktor.routing.routing
|
import io.ktor.routing.routing
|
||||||
import io.ktor.server.engine.embeddedServer
|
import io.ktor.server.engine.embeddedServer
|
||||||
import io.ktor.server.netty.Netty
|
import io.ktor.server.netty.Netty
|
||||||
import kompendium.Library
|
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
embeddedServer(
|
embeddedServer(
|
||||||
@ -22,7 +21,7 @@ fun Application.mainModule() {
|
|||||||
routing {
|
routing {
|
||||||
route("/") {
|
route("/") {
|
||||||
get {
|
get {
|
||||||
call.respondText(Library().someLibraryMethod())
|
call.respondText("hi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user