diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 1891fdb64..f52bd48c0 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -15,9 +15,6 @@ jobs: with: gradle-version: wrapper arguments: detekt - properties: | - org.gradle.vfs.watch=false - org.gradle.vfs.verbose=false unit: runs-on: ubuntu-latest steps: @@ -32,6 +29,3 @@ jobs: with: gradle-version: wrapper arguments: test koverCollectReports - properties: | - org.gradle.vfs.watch=false - org.gradle.vfs.verbose=false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d47688c5c..75722813f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,8 @@ name: Publish to GitHub Packages on: push: branches: [ main ] + paths-ignore: + - docs/** env: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} @@ -19,8 +21,5 @@ jobs: with: gradle-version: wrapper arguments: publishAllPublicationsToGithubPackagesRepository - properties: | - org.gradle.vfs.watch=false - org.gradle.vfs.verbose=false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c47f9d59..186bab651 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,23 +8,6 @@ env: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} jobs: - publish-to-github: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '17' - - name: Publish to GitHub Packages - uses: burrunan/gradle-cache-action@v1 - with: - gradle-version: wrapper - arguments: publishAllPublicationsToGithubPackagesRepository - properties: | - release=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-to-nexus: runs-on: ubuntu-latest steps: @@ -43,3 +26,28 @@ jobs: env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USER }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + build-documentation: + runs-on: ubuntu-latest + needs: + - publish-to-nexus + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '17' + - name: Build New Documentation + uses: burrunan/gradle-cache-action@v1 + with: + gradle-version: wrapper + arguments: dokkaHtmlMultiModule + properties: | + release=true + - name: Push New Documentation + uses: EndBug/add-and-commit@v7 + with: + default_author: github_actions + branch: main + message: 'doc: Added Latest Documentation ✨' diff --git a/CHANGELOG.md b/CHANGELOG.md index 229778b2a..145749594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,8 @@ ## Unreleased ### Added -- Support for HTTP Patch, Head, and Options methods -- Support for including parameter examples via `MethodInfo` ### Changed -- Kompendium now leverages the chosen API serializer. Supports Jackson, Gson and Kotlinx Serialization -- Fixed bug where overridden field names were not reflected in serialized object and required array -- Fixed bug where Ktor Location parents were not being scanned for parameters ### Remove @@ -16,7 +11,20 @@ ## Released -## [2.0.0-alpha] - January 2nd, 2021 +## [2.0.0-beta] - January 12th, 2022 +### Added +- Support for HTTP Patch, Head, and Options methods +- Support for including parameter examples via `MethodInfo` +- Dokka Pipeline Generation +- GitHub Pages integration +- Sourdough Gradle updates + +### Changed +- Kompendium now leverages the chosen API serializer. Supports Jackson, Gson and Kotlinx Serialization +- Fixed bug where overridden field names were not reflected in serialized object and required array +- Fixed bug where Ktor Location parents were not being scanned for parameters + +## [2.0.0-alpha] - January 2nd, 2022 ### Added - Support for OAuth authentication - Gradle Toolchain feature to ensure match between local JDK and compile target diff --git a/Project.md b/Project.md new file mode 100644 index 000000000..2707fc77c --- /dev/null +++ b/Project.md @@ -0,0 +1,41 @@ +# Kompendium + +Welcome to Kompendium, the straight-forward, minimally-invasive OpenAPI generator for Ktor. + +## How to install + +Kompendium publishes all releases to Maven Central. As such, using the release versions of `Kompendium` is as simple as +declaring it as an implementation dependency in your `build.gradle.kts` + +```kotlin +repositories { + mavenCentral() +} + +dependencies { + implementation("io.bkbn:kompendium-core:latest.release") +} +``` + +In addition to publishing releases to Maven Central, a snapshot version gets published to GitHub Packages on every merge +to `main`. These can be consumed by adding the repository to your gradle build file. Instructions can be +found [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package) + +## Setting up the Kompendium Plugin + +Kompendium is instantiated as a Ktor Feature/Plugin. It can be added to your API as follows + +```kotlin +private fun Application.mainModule() { + // Installs the Kompendium Plugin and sets up baseline server metadata + install(Kompendium) { + spec = OpenApiSpec(/*..*/) + } + // ... +} +``` + +## Notarization + +The concept of notarizing routes / exceptions / etc. is central to Kompendium. More details on _how_ to notarize your +API can be found in the kompendium-core module. diff --git a/README.md b/README.md index 272fd4848..6760bba91 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,13 @@ dependencies { } ``` -The last two dependencies are optional. - In addition to publishing releases to Maven Central, a snapshot version gets published to GitHub Packages on every merge to `main`. These can be consumed by adding the repository to your gradle build file. Instructions can be found [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package) # Library Details -Details on how to use Kompendium can be found in the Wiki (WIP, this is new for V2 and will be fleshed out prior to release) +Forthcoming, more details on V2 will be published soon :) ## Local Development diff --git a/build.gradle.kts b/build.gradle.kts index 141ff588e..41656cb82 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,10 @@ -import io.bkbn.sourdough.gradle.core.extension.SourdoughLibraryExtension - plugins { - id("io.bkbn.sourdough.root") version "0.3.3" + kotlin("jvm") version "1.6.10" apply false + id("io.bkbn.sourdough.root") version "0.5.4" id("com.github.jakemarsden.git-hooks") version "0.0.2" -} - -sourdough { - toolChainJavaVersion.set(JavaLanguageVersion.of(JavaVersion.VERSION_17.majorVersion)) - jvmTarget.set(JavaVersion.VERSION_11.majorVersion) - compilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn")) + id("org.jetbrains.dokka") version "1.6.10" + id("org.jetbrains.kotlinx.kover") version "0.5.0-RC" + id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } gitHooks { @@ -31,21 +27,3 @@ allprojects { } } } - -subprojects { - if (this.name != "kompendium-playground") { - apply(plugin = "io.bkbn.sourdough.library") - - configure { - githubOrg.set("bkbnio") - githubRepo.set("kompendium") - libraryName.set("Kompendium") - libraryDescription.set("A minimally invasive OpenAPI spec generator for Ktor") - licenseName.set("MIT License") - licenseUrl.set("https://mit-license.org") - developerId.set("bkbnio") - developerName.set("Ryan Brink") - developerEmail.set("admin@bkbn.io") - } - } -} diff --git a/kompendium-annotations/Module.md b/kompendium-annotations/Module.md index 294dc7523..51d3df474 100644 --- a/kompendium-annotations/Module.md +++ b/kompendium-annotations/Module.md @@ -7,3 +7,7 @@ It is separated from core predominantly to allow for potential future integratio # Package io.bkbn.kompendium.annotations Contains all annotations used by Kompendium + +# Package io.bkbn.kompendium.annotations.constraint + +Annotations that place bespoke constraints on individual fields of your API schemas. diff --git a/kompendium-annotations/build.gradle.kts b/kompendium-annotations/build.gradle.kts index 57decae86..fbda6569b 100644 --- a/kompendium-annotations/build.gradle.kts +++ b/kompendium-annotations/build.gradle.kts @@ -1,3 +1,29 @@ plugins { - id("io.bkbn.sourdough.library") + kotlin("jvm") + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") +} + +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium Annotations") + libraryDescription.set("A set of annotations used by Kompendium to generate OpenAPI Specifications") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") +} + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } } diff --git a/kompendium-auth/Module.md b/kompendium-auth/Module.md index 6869a9798..425ede7e1 100644 --- a/kompendium-auth/Module.md +++ b/kompendium-auth/Module.md @@ -5,5 +5,9 @@ their API authentication with minimal modifications to their existing configurat # Package io.bkbn.kompendium.auth -Base package that is responsible for setting up required authentication route handlers along with exposing -wrapper methods for each ktor-auth authentication mechanism. +Base package that is responsible for setting up required authentication route handlers along with exposing wrapper +methods for each ktor-auth authentication mechanism. + +# Package io.bkbn.kompendium.auth + +Houses the available security configurations. At the moment, `Basic`, `JWT`, `ApiKey`, and `OAuth` are supported diff --git a/kompendium-auth/build.gradle.kts b/kompendium-auth/build.gradle.kts index c321c24cc..6075a91f7 100644 --- a/kompendium-auth/build.gradle.kts +++ b/kompendium-auth/build.gradle.kts @@ -1,7 +1,24 @@ plugins { - id("io.bkbn.sourdough.library") + kotlin("jvm") + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") } +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium Authentication") + libraryDescription.set("Kompendium library to pair with Ktor Auth to provide authorization info to OpenAPI") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") +} dependencies { // IMPLEMENTATION @@ -16,3 +33,11 @@ dependencies { testImplementation(testFixtures(projects.kompendiumCore)) } + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } +} diff --git a/kompendium-core/Module.md b/kompendium-core/Module.md index d1d8a645c..628d446ca 100644 --- a/kompendium-core/Module.md +++ b/kompendium-core/Module.md @@ -1,9 +1,100 @@ # Module kompendium-core -This is where the magic happens. This module houses all the reflective goodness that powers Kompendium. +This is where the magic happens. This module houses all the reflective goodness that powers Kompendium. -It is also the only mandatory client-facing module for a basic setup. +It is also the only mandatory client-facing module for a basic setup. # Package io.bkbn.kompendium.core -The root package contains several objects that power Kompendium +The root package contains several objects that power Kompendium, including the Kompendium Ktor Plugin, route +notarization methods, and the reflection engine that analyzes method info type parameters. + +## Plugin + +The Kompendium plugin is an extremely light-weight plugin, with only a couple areas of customization. + +### Serialization + +Kompendium relies on your API to provide a properly-configured `ContentNegotiator` in order to convert the `OpenApiSpec` +into JSON. The advantage to this approach is that all of your data classes will be serialized precisely how you define. +The downside is that issues could exist in serialization frameworks that have not been tested. At the moment, Jackson, +Gson and KotlinX serialization have all been tested. If you run into any serialization issues, particularly with a +serializer not listed above, please open an issue on GitHub 🙏 + +## Notarization + +Central to Kompendium is the concept of notarization. + +Notarizing a route is the mechanism by which Kompendium analyzes your route types, along with provided metadata, and +converts to the expected OpenAPI format. + +Before jumping into notarization, lets first look at a standard Ktor route + +```kotlin +routing { + get { + call.respond(HttpStatusCode.OK, BasicResponse(c = UUID.randomUUID().toString())) + } +} +``` + +Now, let's compare this to the same functionality, but notarized using Kompendium + +```kotlin +routing { + notarizedGet(simpleGetExample) { + call.respond(HttpStatusCode.OK, BasicResponse(c = UUID.randomUUID().toString())) + } +} +``` + +Pretty simple huh. But hold on... what is this `simpleGetExample`? How can I know that it is so "simple". Let's take a +look + +```kotlin +val simpleGetExample = GetInfo( + summary = "Simple, Documented GET Request", + description = "This is to showcase just how easy it is to document your Ktor API!", + responseInfo = ResponseInfo( + status = HttpStatusCode.OK, + description = "This means everything went as expected!", + examples = mapOf("demo" to BasicResponse(c = "52c099d7-8642-46cc-b34e-22f39b923cf4")) + ), + tags = setOf("Simple") +) +``` + +See, not so bad 😄 `GetInfo<*,*>` is an implementation of `MethodInfo`, a sealed interface designed to +encapsulate all the metadata required for documenting an API route. Kompendium leverages this data, along with the +provided type parameters `TParam` and `TResp` to construct the full OpenAPI Specification for your route. + +Additionally, just as a backup, each notarization method includes a "post-processing' hook that will allow you to have +final say in the generated route info prior to being attached to the spec. This can be accessed via the optional +parameter + +```kotlin +routing { + notarizedGet(simpleGetExample, postProcess = { spec -> spec }) { + call.respond(HttpStatusCode.OK, BasicResponse(c = UUID.randomUUID().toString())) + } +} +``` + +This should only be used in _extremely_ rare scenarios, but it is nice to know it is there if you need it. + +# Package io.bkbn.kompendium.core.metadata + +Houses all interfaces and types related to describing route metadata. + +# Package io.bkbn.kompendium.core.parser + +Responsible for the parse of method information. Base implementation is an interface to support extensibility as shown +in the `kompendium-locations` module. + +# Package io.bkbn.kompendium.core.routes + +Houses any routes provided by the core module. At the moment the only supported route is to enable ReDoc support. + +# Package io.bkbn.kompendium.core.util + +Collection of utility functions used by Kompendium diff --git a/kompendium-core/build.gradle.kts b/kompendium-core/build.gradle.kts index a862366e6..d7fea3af5 100644 --- a/kompendium-core/build.gradle.kts +++ b/kompendium-core/build.gradle.kts @@ -1,6 +1,25 @@ plugins { - id("io.bkbn.sourdough.library") - `java-test-fixtures` + kotlin("jvm") + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") + id("java-test-fixtures") +} + +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium Core") + libraryDescription.set("Core functionality for the Kompendium library") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") + compilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn")) } dependencies { @@ -31,3 +50,11 @@ dependencies { testFixturesApi(group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.3.2") } + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } +} diff --git a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/DefaultMethodParser.kt b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/DefaultMethodParser.kt deleted file mode 100644 index 80a394fcf..000000000 --- a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/DefaultMethodParser.kt +++ /dev/null @@ -1,5 +0,0 @@ -package io.bkbn.kompendium.core - -import io.bkbn.kompendium.core.parser.IMethodParser - -object DefaultMethodParser : IMethodParser diff --git a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/Notarized.kt b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/Notarized.kt index 8fc4083a6..346809db0 100644 --- a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/Notarized.kt +++ b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/Notarized.kt @@ -1,9 +1,7 @@ package io.bkbn.kompendium.core import io.bkbn.kompendium.annotations.Param -import io.bkbn.kompendium.core.DefaultMethodParser.calculateRoutePath import io.bkbn.kompendium.core.KompendiumPreFlight.methodNotarizationPreFlight -import io.bkbn.kompendium.core.DefaultMethodParser.parseMethodInfo import io.bkbn.kompendium.core.metadata.method.DeleteInfo import io.bkbn.kompendium.core.metadata.method.GetInfo import io.bkbn.kompendium.core.metadata.method.HeadInfo @@ -11,6 +9,8 @@ import io.bkbn.kompendium.core.metadata.method.OptionsInfo import io.bkbn.kompendium.core.metadata.method.PatchInfo import io.bkbn.kompendium.core.metadata.method.PostInfo import io.bkbn.kompendium.core.metadata.method.PutInfo +import io.bkbn.kompendium.core.parser.DefaultMethodParser.calculateRoutePath +import io.bkbn.kompendium.core.parser.DefaultMethodParser.parseMethodInfo import io.bkbn.kompendium.oas.path.Path import io.bkbn.kompendium.oas.path.PathOperation import io.ktor.application.ApplicationCall diff --git a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/metadata/method/MethodInfo.kt b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/metadata/method/MethodInfo.kt index 6a53f111e..141338258 100644 --- a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/metadata/method/MethodInfo.kt +++ b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/metadata/method/MethodInfo.kt @@ -22,8 +22,3 @@ sealed interface MethodInfo { val operationId: String? get() = null } - -fun main() { - data class Potato(val a: String) - println(Potato::a) -} diff --git a/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/parser/DefaultMethodParser.kt b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/parser/DefaultMethodParser.kt new file mode 100644 index 000000000..bcd99e963 --- /dev/null +++ b/kompendium-core/src/main/kotlin/io/bkbn/kompendium/core/parser/DefaultMethodParser.kt @@ -0,0 +1,3 @@ +package io.bkbn.kompendium.core.parser + +object DefaultMethodParser : IMethodParser diff --git a/kompendium-locations/Module.md b/kompendium-locations/Module.md index 3718d3ffa..9a1b8a32d 100644 --- a/kompendium-locations/Module.md +++ b/kompendium-locations/Module.md @@ -1 +1,4 @@ # Module kompendium-locations + +Adds support for Ktor [Locations](https://ktor.io/docs/locations.html) API. Any notarized location _must_ be provided +with a `TParam` annotated with `@Location`. Nested Locations are supported diff --git a/kompendium-locations/build.gradle.kts b/kompendium-locations/build.gradle.kts index e70daf0e7..6c4601fd3 100644 --- a/kompendium-locations/build.gradle.kts +++ b/kompendium-locations/build.gradle.kts @@ -1,5 +1,24 @@ plugins { - id("io.bkbn.sourdough.library") + kotlin("jvm") + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") +} + +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium Locations") + libraryDescription.set("Supplemental library for Kompendium offering support for Ktor's Location API") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") + compilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn")) } dependencies { @@ -14,3 +33,11 @@ dependencies { testImplementation(testFixtures(projects.kompendiumCore)) } + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } +} diff --git a/kompendium-oas/build.gradle.kts b/kompendium-oas/build.gradle.kts index aad87113f..24a1216af 100644 --- a/kompendium-oas/build.gradle.kts +++ b/kompendium-oas/build.gradle.kts @@ -1,8 +1,35 @@ plugins { - id("io.bkbn.sourdough.library") + kotlin("jvm") kotlin("plugin.serialization") version "1.6.10" + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") +} + +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium OpenAPI Spec") + libraryDescription.set("Collections of kotlin data classes modeling the OpenAPI specification") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") + compilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn")) } dependencies { implementation(group = "org.jetbrains.kotlinx", "kotlinx-serialization-json", version = "1.3.1") } + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } +} diff --git a/kompendium-playground/build.gradle.kts b/kompendium-playground/build.gradle.kts index 4974ed053..05331639f 100644 --- a/kompendium-playground/build.gradle.kts +++ b/kompendium-playground/build.gradle.kts @@ -1,6 +1,12 @@ plugins { + kotlin("jvm") kotlin("plugin.serialization") version "1.6.10" - application + id("io.bkbn.sourdough.application.jvm") version "0.5.4" + id("application") +} + +sourdough { + compilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn")) } dependencies { diff --git a/kompendium-playground/src/main/kotlin/io/bkbn/kompendium/playground/util/Util.kt b/kompendium-playground/src/main/kotlin/io/bkbn/kompendium/playground/util/Util.kt index bc388343d..c817bada2 100644 --- a/kompendium-playground/src/main/kotlin/io/bkbn/kompendium/playground/util/Util.kt +++ b/kompendium-playground/src/main/kotlin/io/bkbn/kompendium/playground/util/Util.kt @@ -6,9 +6,11 @@ import io.bkbn.kompendium.oas.info.Info import io.bkbn.kompendium.oas.info.License import io.bkbn.kompendium.oas.serialization.KompendiumSerializersModule import io.bkbn.kompendium.oas.server.Server +import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json import java.net.URI +@OptIn(ExperimentalSerializationApi::class) object Util { val kotlinxConfig = Json { classDiscriminator = "class" diff --git a/kompendium-swagger-ui/Module.md b/kompendium-swagger-ui/Module.md index 51b850298..19bcca090 100644 --- a/kompendium-swagger-ui/Module.md +++ b/kompendium-swagger-ui/Module.md @@ -1 +1,3 @@ # Module kompendium-swagger-ui + +Contains the code necessary to launch `swagger` as your documentation frontend. diff --git a/kompendium-swagger-ui/build.gradle.kts b/kompendium-swagger-ui/build.gradle.kts index 981a49d3f..02a20918f 100644 --- a/kompendium-swagger-ui/build.gradle.kts +++ b/kompendium-swagger-ui/build.gradle.kts @@ -1,5 +1,23 @@ plugins { - id("io.bkbn.sourdough.library") + kotlin("jvm") + id("io.bkbn.sourdough.library.jvm") version "0.5.4" + id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.adarshr.test-logger") version "3.1.0" + id("org.jetbrains.dokka") + id("maven-publish") + id("java-library") +} + +sourdough { + githubOrg.set("bkbnio") + githubRepo.set("kompendium") + libraryName.set("Kompendium Swagger") + libraryDescription.set("Offers Swagger as a bundled WebJAR for Ktor") + licenseName.set("MIT License") + licenseUrl.set("https://mit-license.org") + developerId.set("unredundant") + developerName.set("Ryan Brink") + developerEmail.set("admin@bkbn.io") } dependencies { @@ -8,3 +26,11 @@ dependencies { implementation(group = "io.ktor", name = "ktor-webjars", version = ktorVersion) implementation(group = "org.webjars", name = "swagger-ui", version = "4.1.3") } + +testing { + suites { + named("test", JvmTestSuite::class) { + useJUnitJupiter() + } + } +}