Are there any release notes for 3.3.0?
# ktor
s
Are there any release notes for 3.3.0?
b
work in progress, stay tuned ⏳
e
^ Are there any examples of the new openapi generator? A blog post?
b
documentation still isn't ready, but there's an example in the gradle plugin repo that you can check for the time being https://github.com/ktorio/ktor-build-plugins/tree/main/samples/ktor-openapi-sample the extension will add a
buildOpenApi
target for generating a spec from your code
K 2
a
HTTP/2 without TLS ❤️
s
@Bruce HamiltonI used the exact same build config and OpenAPI route, but at runtime, it throws the following error. Any idea what’s the issue?
Copy code
java.io.FileNotFoundException: Swagger file not found: openapi/generated.json
	at io.ktor.server.plugins.openapi.OpenAPIKt.readOpenAPIFile(OpenAPI.kt:59)
	at io.ktor.server.plugins.openapi.OpenAPIKt.openAPI(OpenAPI.kt:29)
	at io.ktor.server.plugins.openapi.OpenAPIKt.openAPI$default(OpenAPI.kt:24)
Copy code
implementation(libs.ktor.server.openapi)
...
  @OptIn(OpenApiPreview::class)
  openApi {
    title = description
    version = "2.1"
    summary = "$description API"
  }
ktor 3.3.0 + 2.2.20
b
there's a new gradle target
buildOpenApi
that will generate the file
s
Also, after adding that single dependency (
implementation(libs.ktor.server.openApi
) , the final binary size increased from 35 Mb to 50Mb. Isn’t this supposed to be generated at build time..rt?
b
Ohh interesting. The OpenAPI plugin is only for generating the page from the spec, it hasn't changed in 3.3.0
s
I can see the following transitive dependencies added to the final binaries
Copy code
-rw-r--r--  1  1.2M Feb  1  1980 rhino-1.7.7.2.jar
-rw-r--r--  1  1.6M Feb  1  1980 swagger-codegen-generators-1.0.57.jar
-rw-r--r--  1  3.4M Feb  1  1980 swagger-codegen-2.4.46.jar
b
the SwaggerUI plugin might be smaller
s
By the way, I’m using Gradle
9.1.0-rc-4
(if that matters), but
buildOpenApi
still doesn’t generate anything 🤔
b
is there anything in the logs? there should be something under
build/ktor
e
I ran
gradle kotest
and it triggered
buildOpenApi
. Does anyone know why?
b
buildOpenApi
is itself a compile task, so maybe the kotest plugin is iterating through all the compile tasks... otherwise it's independent and shouldn't be triggered unless specified
e
Should they not be iterating over all compile tasks? @Vampire
v
Why do you ask me? o_O
I have no idea what kotest should or should not do
b
it seems like that's what it's doing... for now I supposed you'll need a
-x buildOpenApi
when running kotest