Hi Team, I am facing an issue with Ktor OpenAPI ge...
# ktor
s
Hi Team, I am facing an issue with Ktor OpenAPI generation. • Ktor: 3.3.0 • Kotlin: 2.2.20 • Gradle: 9.2.1 Issue Running
./gradlew buildOpenApi
fails with below error. Attaching full stacktrace for reference. Thanks in advance.
Copy code
java.lang.StackOverflowError
at io.ktor.openapi.model.JsonSchema.asJsonSchema
a
The OpenAPI generation has been significantly reforged in Ktor 3.4.0. Can you please try using the latest released version of Ktor, 3.4.2?
s
Sure, thanks. We will try to upgrade.
Hi @Aleksei Tirman [JB], with ktor 3.4.1 also I am getting similar errors. When I am commenting out the routes consuming self-referential models it is working. data class QualityRuleWithLatestExecution( val rule: QualityRule, val execution: RuleExecution? = null, val childRules: List<QualityRuleWithLatestExecution> = listOf(), val executionMetrics: QualityRuleExecutionMetrics? = null ) Could you tell me how can we include such models in openapi generation? Thanks, Sangeeta
a
Can you please try Ktor 3.4.2? If the exception is still thrown, can you please share a code snippet to reproduce the problem?
s
Sure
This is working with the 3.4.2 version of ktor. thanks