Compare commits
53 Commits
v4.0.0-tes
...
main
Author | SHA1 | Date | |
---|---|---|---|
c3526dc807 | |||
a24abad7ad | |||
ef92254b99 | |||
0ef755a0f4 | |||
1d16bcccd6 | |||
90d78a1898 | |||
797fdabf5d | |||
140130fd34 | |||
b449545460 | |||
8f711bbd62 | |||
1d0d18b254 | |||
e021efd8f2 | |||
97a46ae8c6 | |||
f7b90bc795 | |||
99b9addb00 | |||
b452d95764 | |||
641ab78ebd | |||
60aa7b885a | |||
9fcb591795 | |||
1a70e66daf | |||
afc69f447d | |||
0fbf7361d0 | |||
05bf4475cc | |||
bdea0de2c5 | |||
d0c91d1ec1 | |||
819739d7f1 | |||
6ccefae81c | |||
6b7c789dd2 | |||
054f6aad44 | |||
958beb1b9c | |||
a0489d4a00 | |||
20cdf6bcad | |||
803d1c5451 | |||
b9b26ea8eb | |||
08c7ad08bc | |||
506372b74c | |||
29a38f72b8 | |||
fd1996bdd4 | |||
2084828eec | |||
417e21c0a7 | |||
641c995171 | |||
a7d6b0dd70 | |||
c9eb45ff1d | |||
38081606f3 | |||
4562c8f7e5 | |||
0e2f7acb24 | |||
636bf65c36 | |||
4a9165fd3a | |||
c2ce172024 | |||
d94eae93ad | |||
f874cb74e3 | |||
9bd3b2e1e6 | |||
0958d5a874 |
4
.github/workflows/pr_checks.yml
vendored
4
.github/workflows/pr_checks.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
distribution: 'adopt'
|
||||
java-version: '21'
|
||||
- name: Lint
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
uses: burrunan/gradle-cache-action@v2
|
||||
with:
|
||||
gradle-version: wrapper
|
||||
arguments: detekt
|
||||
@ -25,7 +25,7 @@ jobs:
|
||||
distribution: 'adopt'
|
||||
java-version: '21'
|
||||
- name: Unit Tests
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
uses: burrunan/gradle-cache-action@v2
|
||||
with:
|
||||
gradle-version: wrapper
|
||||
arguments: test koverHtmlReport
|
||||
|
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@ -14,16 +14,16 @@ jobs:
|
||||
distribution: 'adopt'
|
||||
java-version: '21'
|
||||
- name: Publish to Maven Central
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
uses: burrunan/gradle-cache-action@v2
|
||||
with:
|
||||
gradle-version: wrapper
|
||||
arguments: publishAndReleaseToMavenCentral
|
||||
arguments: publishAndReleaseToMavenCentral --no-configuration-cache --stacktrace
|
||||
properties: |
|
||||
SONATYPE_AUTOMATIC_RELEASE=true
|
||||
release=true
|
||||
env:
|
||||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_SIGNING_KEY_ID }}
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}
|
||||
# NOTE: FML https://stackoverflow.com/a/39573795
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKeyId: FF618132
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_SIGNING_PASSWORD }}
|
||||
|
926
CHANGELOG.md
926
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -3,13 +3,13 @@ import io.bkbn.sourdough.gradle.library.jvm.LibraryJvmPlugin
|
||||
import io.bkbn.sourdough.gradle.library.jvm.LibraryJvmExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "2.0.21" apply false
|
||||
kotlin("plugin.serialization") version "2.0.21" apply false
|
||||
id("io.bkbn.sourdough.library.jvm") version "0.13.0" apply false
|
||||
id("io.bkbn.sourdough.application.jvm") version "0.13.0" apply false
|
||||
id("com.vanniktech.maven.publish") version "0.30.0" apply false
|
||||
id("io.bkbn.sourdough.root") version "0.13.0"
|
||||
id("org.jetbrains.kotlinx.kover") version "0.8.3"
|
||||
kotlin("jvm") version "2.1.20" apply false
|
||||
kotlin("plugin.serialization") version "2.1.20" apply false
|
||||
id("io.bkbn.sourdough.library.jvm") version "0.13.1" apply false
|
||||
id("io.bkbn.sourdough.application.jvm") version "0.13.1" apply false
|
||||
id("com.vanniktech.maven.publish") version "0.31.0" apply false
|
||||
id("io.bkbn.sourdough.root") version "0.13.1"
|
||||
id("org.jetbrains.kotlinx.kover") version "0.9.1"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -10,6 +10,7 @@ import io.bkbn.kompendium.core.fixtures.TestSimpleRequest
|
||||
import io.bkbn.kompendium.core.metadata.GetInfo
|
||||
import io.bkbn.kompendium.core.metadata.PostInfo
|
||||
import io.bkbn.kompendium.core.plugin.NotarizedRoute
|
||||
import io.bkbn.kompendium.enrichment.BooleanEnrichment
|
||||
import io.bkbn.kompendium.enrichment.CollectionEnrichment
|
||||
import io.bkbn.kompendium.enrichment.MapEnrichment
|
||||
import io.bkbn.kompendium.enrichment.NumberEnrichment
|
||||
@ -63,6 +64,9 @@ fun Route.enrichedSimpleRequest() {
|
||||
deprecated = true
|
||||
}
|
||||
}
|
||||
TestSimpleRequest::c {
|
||||
BooleanEnrichment("blah-blah-blah") { }
|
||||
}
|
||||
}
|
||||
)
|
||||
description("A test request")
|
||||
|
@ -109,11 +109,15 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -109,11 +109,15 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -109,11 +109,15 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -144,11 +144,15 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -111,11 +111,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -76,11 +76,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -111,11 +111,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
},
|
||||
"TestSimpleRequest-blah-blah": {
|
||||
@ -129,11 +133,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
},
|
||||
"List-TestSimpleRequest-blah-blah": {
|
||||
|
@ -64,11 +64,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
},
|
||||
"TestSimpleRequest-blah": {
|
||||
@ -82,11 +86,15 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
},
|
||||
"Map-String-TestSimpleRequest-blah": {
|
||||
|
@ -23,7 +23,8 @@ data class TestRequest(
|
||||
@Serializable
|
||||
data class TestSimpleRequest(
|
||||
val a: String,
|
||||
val b: Int
|
||||
val b: Int,
|
||||
val c: Boolean
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
@ -1,9 +1,8 @@
|
||||
# Kompendium
|
||||
project.version=4.0.0-test
|
||||
project.version=4.0.3
|
||||
|
||||
# Kotlin
|
||||
kotlin.code.style=official
|
||||
#kotlin.experimental.tryK2=true
|
||||
|
||||
# Gradle
|
||||
org.gradle.vfs.watch=true
|
||||
@ -12,8 +11,8 @@ org.gradle.jvmargs=-Xmx2000m
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Dependencies
|
||||
kotlinVersion=2.0.21
|
||||
kotlinSerializeVersion=1.7.+
|
||||
ktorVersion=3.0.1
|
||||
kotestVersion=6.0.0.M1
|
||||
detektVersion=1.23.7
|
||||
kotlinVersion=2.1.20
|
||||
kotlinSerializeVersion=1.8.0
|
||||
ktorVersion=3.1.2
|
||||
kotestVersion=6.0.0.M3
|
||||
detektVersion=1.23.8
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
8
gradlew
vendored
8
gradlew
vendored
@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@ -84,7 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@ -203,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.bkbn.kompendium.json.schema.handler
|
||||
|
||||
import io.bkbn.kompendium.enrichment.BooleanEnrichment
|
||||
import io.bkbn.kompendium.enrichment.CollectionEnrichment
|
||||
import io.bkbn.kompendium.enrichment.Enrichment
|
||||
import io.bkbn.kompendium.enrichment.MapEnrichment
|
||||
@ -15,6 +16,7 @@ import io.bkbn.kompendium.json.schema.definition.TypeDefinition
|
||||
object EnrichmentHandler {
|
||||
|
||||
fun Enrichment.applyToSchema(schema: JsonSchema): JsonSchema = when (this) {
|
||||
is BooleanEnrichment -> applyToSchema(schema)
|
||||
is NumberEnrichment -> applyToSchema(schema)
|
||||
is StringEnrichment -> applyToSchema(schema)
|
||||
is CollectionEnrichment<*> -> applyToSchema(schema)
|
||||
@ -39,6 +41,11 @@ object EnrichmentHandler {
|
||||
else -> error("Incorrect enrichment type for enrichment id: ${this.id}")
|
||||
}
|
||||
|
||||
private fun BooleanEnrichment.applyToSchema(schema: JsonSchema): JsonSchema = when (schema) {
|
||||
is TypeDefinition -> schema.copyBooleanEnrichment(this)
|
||||
else -> error("Incorrect enrichment type for enrichment id: ${this.id}")
|
||||
}
|
||||
|
||||
private fun NumberEnrichment.applyToSchema(schema: JsonSchema): JsonSchema = when (schema) {
|
||||
is TypeDefinition -> schema.copyNumberEnrichment(this)
|
||||
else -> error("Incorrect enrichment type for enrichment id: ${this.id}")
|
||||
@ -49,6 +56,13 @@ object EnrichmentHandler {
|
||||
else -> error("Incorrect enrichment type for enrichment id: ${this.id}")
|
||||
}
|
||||
|
||||
private fun TypeDefinition.copyBooleanEnrichment(
|
||||
enrichment: BooleanEnrichment
|
||||
): TypeDefinition = copy(
|
||||
deprecated = enrichment.deprecated,
|
||||
description = enrichment.description,
|
||||
)
|
||||
|
||||
private fun TypeDefinition.copyNumberEnrichment(
|
||||
enrichment: NumberEnrichment
|
||||
): TypeDefinition = copy(
|
||||
|
@ -7,10 +7,14 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
|
@ -7,10 +7,14 @@
|
||||
"b": {
|
||||
"type": "number",
|
||||
"format": "int32"
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
|
@ -9,10 +9,14 @@
|
||||
"type": "number",
|
||||
"format": "int32",
|
||||
"deprecated": true
|
||||
},
|
||||
"c": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"a",
|
||||
"b"
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
|
@ -34,16 +34,16 @@ dependencies {
|
||||
|
||||
// Logging
|
||||
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.5.0")
|
||||
implementation("org.apache.logging.log4j:log4j-api:2.24.1")
|
||||
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
|
||||
implementation("org.slf4j:slf4j-api:2.0.16")
|
||||
implementation("org.slf4j:slf4j-simple:2.0.16")
|
||||
implementation("org.apache.logging.log4j:log4j-api:2.24.3")
|
||||
implementation("org.apache.logging.log4j:log4j-core:2.24.3")
|
||||
implementation("org.slf4j:slf4j-api:2.0.17")
|
||||
implementation("org.slf4j:slf4j-simple:2.0.17")
|
||||
|
||||
// YAML
|
||||
implementation("com.charleskorn.kaml:kaml:0.62.0")
|
||||
implementation("com.charleskorn.kaml:kaml:0.74.0")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializeVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
|
||||
|
||||
implementation("joda-time:joda-time:2.13.0")
|
||||
implementation("joda-time:joda-time:2.14.0")
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ plugins {
|
||||
id("io.bkbn.sourdough.library.jvm")
|
||||
id("io.gitlab.arturbosch.detekt")
|
||||
id("com.adarshr.test-logger")
|
||||
id("com.vanniktech.maven.publish")
|
||||
id("java-library")
|
||||
id("signing")
|
||||
id("org.jetbrains.kotlinx.kover")
|
||||
@ -22,7 +23,7 @@ dependencies {
|
||||
val kotlinSerializeVersion: String by project
|
||||
|
||||
implementation(projects.kompendiumJsonSchema)
|
||||
implementation("com.google.protobuf:protobuf-java:3.25.5")
|
||||
implementation("com.google.protobuf:protobuf-java:3.25.6")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializeVersion")
|
||||
|
||||
|
@ -4,6 +4,7 @@ plugins {
|
||||
id("io.bkbn.sourdough.library.jvm")
|
||||
id("io.gitlab.arturbosch.detekt")
|
||||
id("com.adarshr.test-logger")
|
||||
id("com.vanniktech.maven.publish")
|
||||
id("java-library")
|
||||
id("signing")
|
||||
id("org.jetbrains.kotlinx.kover")
|
||||
|
Reference in New Issue
Block a user