Closed swaechter closed 2 years ago
I've experienced the exact same problem after upgrading to 3.3.0 from 3.2.7
Is there any workaround for this that anyone has figured out?
Alternatively, can someone point me to how to downgrade/override the managed dependency version to 3.2.0
with the Micronaut Application plugin (with Kotlin/kapt
)? Similar to Spring's ext['blah.version'] = '1.2.3'
?
Nothing i do with manual dependencies seems to work...
you can use annotationProcessor("io.micronaut.openapi:micronaut-openapi:3.2.0")
to downgrade
I tried that for kapt
and it didn't work, unfortunately, so assumed some managed platform / strict dependency constraint Gradle hijinx were required to override somehow.
$ grep openapi build.gradle.kts
kapt("io.micronaut.openapi:micronaut-openapi:3.2.0")
$ ./gradlew dependencies | grep openapi
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
are you using enforcedPlatform
instead of platform
in your Gradle config?
Not intentionally, unless Micronaut Application plugin does that behind the scenes. Essentially the same as off Micronaut Launch (distilled version below)
plugins {
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("org.jetbrains.kotlin.kapt") version "1.6.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.6.10"
id("io.micronaut.application") version "3.2.0"
}
group = "example"
repositories {
mavenCentral()
}
micronaut {
version("3.3.0")
runtime("netty")
processing {
incremental(true)
annotations("test.*")
}
}
dependencies {
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
kapt("io.micronaut.openapi:micronaut-openapi:3.2.0")
implementation("io.swagger.core.v3:swagger-annotations")
}
application {
mainClass.set("test.Test")
}
$ ./gradlew dependencies | grep openapi
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
+--- io.micronaut.openapi:micronaut-openapi:3.2.0 -> 4.0.0
| | +--- io.micronaut.openapi:micronaut-openapi:4.0.0 (c)
@chadlwilson I had to !!
my Open API processor to 3.2.0. With this workaround the old behaviour is restored (With the danger of breaking in a future release).
For more information: https://docs.gradle.org/current/userguide/single_versions.html#simple_version_declaration_semantics
Thanks @swaechter - after years of Gradle, I had no idea there was that !!
shorthand for strict constraints. Thanks for teaching me something! That works fine - thanks a lot.
Hey @n0tl3ss thanks a lot for the fix(es), also the one in #661 :)
Problem
In Micronaut 3.3.0 with Micronaut OpenAPI 4.0.0, the return type of a controller action in combination with a custom response description + Javadoc is ignored. This leads to an unusable OpenAPI file that can't be used by clients (E.g. in TypeScript, because the generator doesn't know the return type Greeting)
The code:
On the left the working version in Micronaut 3.2.7 and on the right the dropped fragment in 3.3.0 + Micronaut OpenAPI 4.0.0:
Remarks
Steps To Reproduce
Otherwise: Compare the files Swagger_3.2.7.yml and Swagger_3.3.0.yml with a diff tool
Environment Information
Example Application
Bug 9 in https://github.com/swaechter/openapiproblems
Version
Micronaut 3.3.0 with Micronaut OpenAPI 4.0.0