Skip to content

Upgrading to 0.9 ​

0.9 changes three responses. Most apps need no changes.

405 for wrong methods on pages ​

A POST, PUT, PATCH or DELETE to a path that is a page or file of your build, such as /about, now answers 405 with Allow: GET, HEAD, OPTIONS, instead of 404. OPTIONS answers 204. Paths that resolve to nothing still answer 404.

You are affected if a test or monitor expects 404 for such a request. Update the expected status.

JSON nesting limit ​

JSON request bodies on API paths that nest deeper than 64 levels now answer 400. Real payloads rarely nest beyond 10.

If you accept deeply nested documents, raise the limit, or turn it off with null:

kotlin
install(Svelte) {
    maxJsonDepth = 256
}

maxJsonStringLength can also refuse long strings. It is off by default. See JSON shape.

Request IDs ​

Every request now gets an X-Request-Id response header, and the generated client sends one with each call. Unhandled errors are logged with the ID, and ApiError.requestId carries it in the frontend.

You are affected only if you install Ktor's CallId yourself. ktor-svelte then uses your setup and does not install its own. To turn the feature off, set requestIds = false.

Regenerate the client ​

The generated client now sends request IDs. Start the app once in development, or run ./gradlew svelteGenerateTs, and commit the updated files under src/lib/api.

Documentation for ktor-svelte 1.4.0. Released under the Apache 2.0 license.