Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ktlint = "14.2.0"
knit = "0.5.1"
mavenPublish = "0.36.0"
netty = "4.2.12.Final"
openapi-generator = "7.21.0"

# libraries version
awaitility = "4.3.0"
Expand Down Expand Up @@ -81,4 +80,3 @@ kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-co
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
knit = { id = "org.jetbrains.kotlinx.knit", version.ref = "knit" }
openapi-generator = { id = "org.openapi.generator", version.ref = "openapi-generator" }
29 changes: 0 additions & 29 deletions kotlin-sdk-core/.openapi-generator-ignore

This file was deleted.

56 changes: 0 additions & 56 deletions kotlin-sdk-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,6 @@ plugins {
id("mcp.publishing")
id("mcp.dokka")
alias(libs.plugins.kotlinx.binary.compatibility.validator)
alias(libs.plugins.openapi.generator)
}

/*
tasks.withType<KotlinCompilationTask<*>>().configureEach {
dependsOn(tasks.openApiGenerate)
}

tasks.named("runKtlintCheckOverCommonMainSourceSet") {
dependsOn(tasks.openApiGenerate)
}

// Also ensure it runs before other relevant tasks
tasks.withType<DokkaGenerateTask>().configureEach {
dependsOn(tasks.openApiGenerate)
}

tasks.withType<Task>().configureEach {
if (name.lowercase().contains("sourcesjar")) {
dependsOn(tasks.openApiGenerate)
}
}
*/

openApiGenerate {
val schemaVersion = "2025-03-26" // or "2025-06-18" or "draft"
val schemaUrl =
// "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/$schemaVersion/schema.json"
"https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/tags/$schemaVersion/schema/$schemaVersion/schema.json"
generatorName = "kotlin"
remoteInputSpec = schemaUrl
outputDir = layout.buildDirectory.dir("generated-sources/openapi").get().asFile.absolutePath
packageName = "io.modelcontextprotocol.kotlin.sdk.models"
modelPackage = "io.modelcontextprotocol.kotlin.sdk.models"
apiPackage = "io.modelcontextprotocol.kotlin.sdk.api"
generateModelTests = false
generateModelDocumentation = false
cleanupOutput = false
skipValidateSpec = true // do not validate spec
library.set("multiplatform")
ignoreFileOverride.set("${layout.projectDirectory}/.openapi-generator-ignore")
globalProperties.set(
mapOf(
"supportingFiles" to "",
"models" to "", // or generate all models
),
)
configOptions.set(
mapOf(
"omitGradleWrapper" to "true",
"enumPropertyNaming" to "UPPERCASE",
"dateLibrary" to "kotlinx-datetime",
"explicitApi" to "true",
"modelMutable" to "false",
),
)
}

// Generation library versions
Expand Down
Loading