A serverless RESTful API and router written in Kotlin for AWS Lambda
  • Kotlin 96.8%
  • HCL 3.2%
Find a file
v79 c8d26d82b6
All checks were successful
Native Image Tests / native-test (push) Successful in 7m7s
Claude-authored native image workflow
2026-07-11 07:28:02 +01:00
.forgejo/workflows Claude-authored native image workflow 2026-07-11 07:28:02 +01:00
.github Upgrade dependencies and configurations. Did NOT upgrade to Gradle 9.6.1 as it requires Kotlin 2. 2026-07-04 10:39:36 +01:00
.idea Implement reflection-free OpenAPI 3.1 schema generation and routing spec DSL 2026-07-07 06:50:56 +01:00
gradle/wrapper Upgrade dependencies and configurations. Did NOT upgrade to Gradle 9.6.1 as it requires Kotlin 2. 2026-07-04 10:39:36 +01:00
openapi Implement OpenAPI 3.1 nullability handling and update schema generation 2026-07-07 13:25:49 +01:00
router Correct error-response headers: Content-Type, 406 body, WWW-Authenticate 2026-07-08 20:02:21 +01:00
sample-native Implement OpenAPI 3.1 nullability handling and update schema generation 2026-07-07 13:25:49 +01:00
.gitattributes Merge remote-tracking branch 'origin/main' into claude/graalvm-evaluation-6miOq 2026-07-04 09:11:00 +01:00
.gitignore Stop tracking .idea/awsToolkit.xml 2026-07-04 09:18:13 +01:00
build.gradle.kts Implement OpenAPI 3.1 nullability handling and update schema generation 2026-07-07 13:25:49 +01:00
CLAUDE.md Implement OpenAPI 3.1 nullability handling and update schema generation 2026-07-07 13:25:49 +01:00
GRAALVM_ARM64_NOTES.md Add GRAALVM_ARM64_NOTES.md with assessment for ARM64 native builds 2026-07-04 10:07:15 +01:00
GRAALVM_CONSUMER_GUIDE.md Add native Cognito authorizer sample, remove Auth0 dependencies 2026-07-04 09:59:43 +01:00
GRAALVM_RECOMMENDATIONS.md Add native Cognito authorizer sample, remove Auth0 dependencies 2026-07-04 09:59:43 +01:00
gradle.properties Add GitHub Packages publishing configuration and update project group 2025-09-04 17:44:51 +01:00
gradlew Upgrade dependencies and configurations. Did NOT upgrade to Gradle 9.6.1 as it requires Kotlin 2. 2026-07-04 10:39:36 +01:00
gradlew.bat Upgrade dependencies and configurations. Did NOT upgrade to Gradle 9.6.1 as it requires Kotlin 2. 2026-07-04 10:39:36 +01:00
NATIVE_IMAGE_CHANGES.md Replace KType reflection with compile-time KSerializer for GraalVM native image compatibility and bump version to 0.5.0-SNAPSHOT. 2026-02-14 11:49:24 +00:00
OpenAPISpecNotes.md Notes on what I need to support from the OpenAPI specifications. 2024-06-01 18:24:00 +01:00
README.md Remove deprecated KSP-based OpenAPI annotation processor 2026-07-07 07:53:09 +01:00
settings.gradle.kts Upgrade dependencies and configurations. Did NOT upgrade to Gradle 9.6.1 as it requires Kotlin 2. 2026-07-04 10:39:36 +01:00

APIViaduct

A serverless RESTful API and router written in Kotlin for AWS Lambda

Inspired by my earlier project Cantilever, I wanted to create a more lightweight and flexible API framework for AWS Lambda. This project is a work in progress and is not yet ready for production use. This project will currently run on the JVM, and so has the inherent cold start issues of Java on AWS Lambda. Work is underway to make the library compatible with GraalVM native image compilation — see GRAALVM_RECOMMENDATIONS.md for the current state and GRAALVM_CONSUMER_GUIDE.md for how to build a native Lambda with the library.

RESTful routes will be defined using a Kotlin DSL, and uses Kotlinx Serialization for JSON (de)serialization. The project is built using Gradle and the AWS SDK for Kotlin.

The library will support route grouping, authentication, all the main REST methods, and more. I hope to add an OpenAPI specification generator, and middleware our filters in the future. While the router defaults to JSON, it is possible to specify other content types such as text, YAML or any others supported by kotlinx.serialization.

This library is not intended to be used as a general web server framework.

The library currently builds against Kotlin 1.9.23. The previous KSP2 blocker (the OpenAPI module's kotlin-compile-testing dependency) has been removed along with the old annotation processor, so a move to Kotlin 2.0 is no longer blocked by the OpenAPI module.

Example

  // a simple get request handler
  get("/hello") { _: Request<Unit> ->
    Response.OK("Hello, world!")  
  }
  // a simple post request handler, expecting a JSON body for a data class of type 'Thingy'
  post("/new") { req: Request<Thingy> ->
    val body = req.body
    Response.OK("You sent: ${body.name}")
  }