dave
10/06/2018, 11:03 AMxuemin.guan
10/23/2018, 10:21 AMs4nchez
10/29/2018, 4:05 PMdave
10/30/2018, 9:07 AMdave
11/12/2018, 11:12 AMxuemin.guan
11/23/2018, 10:51 AMdave
11/23/2018, 1:01 PMJetty
object you can see the pattern for how this can be done using an embedded Jetty backends4nchez
11/25/2018, 12:13 PMval defaultStack = Filter.NoOp.then(ClientFilters.GZip())
val additionalFilters: List<Filter> = listOf(
DebuggingFilters.PrintRequestAndResponse(),
ClientFilters.BasicAuth("user", "pass"))
// additional after default
val combinedFilter1: Filter = additionalFilters.fold(defaultStack) { acc, next -> acc.then(next) }
// additional before default
val combinedFilter2: Filter = additionalFilters.fold(Filter.NoOp) { acc, next -> acc.then(next) }.then(defaultStack)
dave
11/29/2018, 3:38 PM{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/someOtherDefinitionId"
},
"description": "the body of the message"
}
dave
12/06/2018, 6:55 AMfredrik.nordin
12/06/2018, 9:33 AMcloudnative
module! Looks great and exactly what was needed for http4k to be a real contender for writing all my k8s hosted services 👏s4nchez
12/06/2018, 11:42 AMreik.schatz
12/07/2018, 2:35 PMRequestTracing
but using Opencensus?tryge
12/11/2018, 1:03 PMCodecraig
12/12/2018, 12:41 PMdave
12/12/2018, 5:31 PMalieksie
12/18/2018, 1:56 PM"/bar/" / Path.string().of(name = "foo")
comes
"/bar/" / Path.string().of(name = "foo").optional
So it would match both /bar/foo
and /bar/
Albert
01/02/2019, 12:48 PMtestApp.testWsClient
but I need something like testApp.testWebsocket
dave
01/30/2019, 5:19 PMDALDEI
01/30/2019, 7:58 PMXavier Hanin
01/31/2019, 8:43 AMnatpryce
01/31/2019, 10:26 AMdave
01/31/2019, 10:52 AMdave
02/01/2019, 10:39 AMBody.autoView<ArbObjectWithView, Public>().toLens()
dave
02/12/2019, 7:24 PMrelease.sh 3.112.2
sahil Lone
02/18/2019, 8:42 AMdave
03/10/2019, 4:47 PMv3.116.0
that we've just released, we've introduced a better API for http4k-contract
which is more consistent with the way we define route
meta. It looks like this: val router = "/basepath" bind contract {
renderer = SimpleJson(Jackson)
descriptionPath = "/swagger.json"
security = ApiKey(Query.required("the_api_key"), { true })
routes += "/descriptions" meta {
summary = "endpoint"
description = "some rambling description of what this thing actually does"
operationId = "echoMessage"
tags += Tag("tag1")
queries += Query.boolean().required("b", "booleanQuery")
receiving(Body.json("json").toLens())
} bindContract GET to { Response(OK) }
}
We've deprecated the old contract()
functions for the time being - they were getting a little out of hand with 8 or so overloaded (and all defaulted anyway) args, hence this change. Have a play and let us know if you like/hate it.
Also in this release, there's a new http4k-template-freemarker
module. 🙄dave
03/25/2019, 8:17 AMdave
03/27/2019, 2:14 PMinterface Approver {
fun <T : HttpMessage> assertApproved(httpMessage: T)
}
fun Approver.assertApproved(response: Response, expectedStatus: Status) =
assertApproved(response.apply { assertEquals(expectedStatus, response.status) })
fun <T : HttpMessage> Approver.hasApprovedContent(): Matcher<T> = ...
The interface method is generified by HttpMessage, so for the first extension to be specific to Response
felt a little wrong. The second was specific to hamkrest, which is totally outside the remit of the actual interface. On top of that, we don't even ship hamkrest with the module, so whilst convienient, it's even further away conceptually from the main interface.dave
03/28/2019, 5:21 AMthen()
. We provide the one below which should give you a general idea, but you can easily write your own to plug in whatever logger you need: object CatchAll {
operator fun invoke(errorStatus: Status = INTERNAL_SERVER_ERROR): Filter = Filter { next ->
{
try {
next(it)
} catch (e: Exception) {
val sw = StringWriter()
e.printStackTrace(PrintWriter(sw))
Response(errorStatus).body(sw.toString())
}
}
}
}
dave
03/28/2019, 5:21 AMthen()
. We provide the one below which should give you a general idea, but you can easily write your own to plug in whatever logger you need: object CatchAll {
operator fun invoke(errorStatus: Status = INTERNAL_SERVER_ERROR): Filter = Filter { next ->
{
try {
next(it)
} catch (e: Exception) {
val sw = StringWriter()
e.printStackTrace(PrintWriter(sw))
Response(errorStatus).body(sw.toString())
}
}
}
}
krtko
03/28/2019, 4:38 PMdave
03/28/2019, 4:39 PMkrtko
03/28/2019, 4:40 PM