Support for Path Parameters (Kotless DSL)
See original GitHub issueDoes the Kotless DSL currently support path parameters? I understand the documentation is a work in progress, so I tried using a few different common patterns e.g. /users/:id, /users/{id} just to check, and none of them seem to be routed to my endpoint.
If it’s the case that it’s not yet implemented, I’d be happy to give it a shot, especially if anyone could point me to the right place for it.
Thanks!
Update: After looking through the source code, it’s pretty obvious this just hasn’t been implemented yet. It seems like the two parts to implementing this are parsing and matching the route in the dispatcher, and then generating the right Terraform output, does that sound about right?
Also, would a PR be accepted if it only implemented this feature for the Kotless DSL?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:6

Top Related StackOverflow Question
Will need it too please
@Serdnad @Sitole
I found a solution that works for me.
Using Ktor I was able to use the Ktor “Locations”-Feature to set up the implementation for my route with path parameters.
Luckily Kotless does not create the terraform code for any “Locations” defined route. So I could write the aws terraform resources (as mentioned in my link above) in an extension file and add it to my terraform deployment.
In my extension I added the required:
in my case this looks like that
notice the path placeholder in the aws_lambda_permission.source_arn
As long as Kotless does not support Ktor Locations…i’m happy