Andrew O'Hara
02/20/2025, 6:11 PMRequestContextKeys
being replacing by RequestKeys
,I no longer need to pass around a shared context and initialize the server filter stack with the context. Super happy with that!Gopal S Akshintala
02/24/2025, 7:17 AMJordan Terrell
02/25/2025, 9:31 PMDanielZ
03/03/2025, 1:19 PMDanielZ
03/04/2025, 10:36 AM6.0.1.0
to 6.1.0.0
I run into java.lang.IllegalStateException: Request was not routed, so no uri-template present
. What I’m doing wrong here?
class AppHttpFilterShould {
@Test
fun `extract customer id for logging`() {
var receivedRequest = Request(GET, "")
val app = routes(
"/v1/customer/{id}" bind GET to { receivedRequest = it; Response(OK) },
"/v1/customer/{other-id}/{x}" bind GET to { receivedRequest = it; Response(OK) },
)
val request = Request(GET, "/v1/customer/407")
app(request)
receivedRequest.identifier() shouldBe Identifier.CustomerId("407")
}
}
sealed interface Identifier {
data class CustomerId(val id: String) : Identifier
data class CompanyId(val id: String, val x: String) : Identifier
data object NoId : Identifier
}
fun Request.identifier(): Identifier {
val id = path("id").orEmpty()
val otherId = path("other-id").orEmpty()
val x = path("x").orEmpty()
return when {
id.isNotBlank() -> Identifier.CustomerId(id)
otherId.isNotBlank() -> Identifier.CompanyId(otherId, x)
else -> Identifier.NoId
}
}
Martin Smiech
03/10/2025, 2:54 PMdave
03/14/2025, 5:18 PMbrew
then Claude will automatically have access to the binary.
The client is specially optimised for servers built with the http4k MCP SDK which is being released in the very near future. With the SDK, you'll be able to build MCP servers as simply as you build HTTP applications with http4k: Clean + Simple + Functional + Testable. 🙃
Check out the full documentation and download options at: https://github.com/http4k/http4k-mcp-desktop
Stay tuned for the http4k MCP SDK release coming soon !
Happy weekend! 🦜dave
03/17/2025, 4:27 PMMrNiamh
03/24/2025, 8:45 AMdata class FieldDTO(
val name: String,
val obj: ObjectField,
){
companion object {
val example = FieldDTO(
name = "Field",
obj = ObjectField.example
)
}
}
data class ObjectField(
val name: String,
val field: FieldDTO? = null,
){
companion object {
val example = ObjectField("obj", field = FieldDTO.example)
}
}
The compiler obviously throws an error on the ObjectField
example, but if I set the example to be ObjectField("obj", field = null)
then I get an issue with NoFieldFound
on generating the openapi as it doesn't like having nulls.
Tried to have a search but couldn't find much on what the best approach here is!Arnab
03/27/2025, 10:48 AM/**
* Load configuration from optional Properties file format on disk
*/
fun fromOptionalFile(file: File): Environment = if (file.exists()) from(file) else EMPTY
Should I just submit a PR and explain my usecase or would you like me to create an issue first? This is a very simple change that has like 5-6 lines total of code (including tests)Andrew O'Hara
03/28/2025, 12:19 PMdave
03/28/2025, 5:51 PMAndrew O'Hara
03/30/2025, 3:03 AMAndrew O'Hara
03/31/2025, 7:15 PMResourceLoadingHandler.loadPath()
filter out requests for octet streams? I'm trying to host an HLS stream, but the static
server is returning 404s for every binary segment after the text playlist.Andrew O'Hara
04/05/2025, 5:52 PMJavaHttpClient
was perfectly fine for production. Is this no longer the case?leonhardt
04/07/2025, 6:03 AMhttp4k-connect-storage-s3
intended to be a provider agnostic S3 adapter, or just for AWS? I was lured into trying it with GCP's cloud storage because "AWS" isn't in the package name, but I'm finding the interface has lots of AWS specifics like:
• the CredentialsProvider interface is expected to return an AwsCredentials object
• region is an enum from org.http4k.connect.amazon.core.modelAndrew O'Hara
04/09/2025, 3:40 PMJonathan Hult
04/10/2025, 2:51 PMorg.http4k:http4k-security-oauth
"pluggable" with other JSON formatters instead of relying directly directly on http4k-format-moshi
?leonhardt
04/11/2025, 6:44 AMhttp4k-api-openapi
module. When using a path lens, I've got a route working when the lens is at the end of a route, but I'm stuck on how to place one in the middle of a route. Any tips?arne.stockmans
04/11/2025, 9:12 AMTim Mortimer
04/12/2025, 9:29 AMGopal S Akshintala
04/17/2025, 10:57 AMTool.Arg
? I am not able to find something like a list()
method?
val pathsArg =
Tool.Arg.string().required("collectionPath", "List of Absolute paths")
I want Cursor to call my MCP with argument like this:
{
"paths": [
"../..",
"/.."
]
}
leonhardt
04/27/2025, 11:13 PMroutes(emptyList())
I get:
Exception in thread "main" java.lang.IllegalArgumentException: No routes added!
at org.http4k.routing.RoutingHandler.<init>(RoutingHandler.kt:19)
at org.http4k.routing.RoutingHttpHandler.<init>(http.kt:23)
Cies
04/28/2025, 12:10 AMEmily
05/04/2025, 9:33 AMArnab
05/08/2025, 8:32 AMEmily
05/09/2025, 1:49 PMString.replace("\n", "")
. This silently breaks with template files using CRLF. A simple solution could be to change it to String.replace("\r\n", "").replace("\n", "")
.dave
05/09/2025, 4:44 PM