Tom Ellis
03/30/2019, 6:48 AMdave
04/01/2019, 8:05 AMkrtko
04/05/2019, 2:58 PMkrtko
04/06/2019, 6:07 AMsoulbeaver
04/07/2019, 1:18 PMdave
04/09/2019, 11:23 AM@JsonTypeInfo
. TBH, I generally try to make DTO objects as dumb as possible as I hate all the annotations.krtko
04/10/2019, 10:41 PMNezteb
04/19/2019, 6:30 PMNezteb
04/22/2019, 6:06 PMNezteb
04/22/2019, 7:04 PMHTTPHandler
class? since all the handlers are functions, i’m not sure how to pass it to them from the routes()
function callNezteb
04/22/2019, 9:31 PM.body
, not .with
, but how can I convert the request to JSON? I could use a Jackson mapper manually, but I assume HTTP4k has a built-in way to do it
fun getRequestAsJson(): HttpHandler {
return {
Response(OK).body(it)
}
}
Nezteb
04/22/2019, 11:01 PMAutoCloseable
thing like a database client that needs to be opened upon request and closed once the response is sent? Or using try-with-resources
?Nezteb
04/23/2019, 2:08 AMFilter
right now to validate it, but I also want to put it on the OpenAPI contract for each route. It looks like the only way for me to require that header on every route is to copy-paste the contract header checks?dave
04/23/2019, 4:18 AMdave
04/23/2019, 9:45 PMNezteb
04/24/2019, 12:10 AMhttp4k-by-example
, the contract module generates these random object927961565
objects. is there a way to name those manually?Nezteb
04/24/2019, 12:18 AMdave
04/24/2019, 5:20 PMdave
04/24/2019, 9:04 PMNezteb
04/24/2019, 10:33 PM/api/v1
three times here?Nezteb
04/25/2019, 12:11 AMNezteb
04/25/2019, 9:36 PMNezteb
04/25/2019, 10:49 PMstatic
.
If I go to the static path /swagger.json
, i see the pictured swagger.json
file. If I go to /swagger.yaml
though, I get a 404.
I noticed static
has an overload with a second argument called extraPairs: Pair<String, ContentType>
. do I have to use that second arg?Nezteb
05/16/2019, 1:40 AMResponse(OK)
, but that’s… mehNezteb
05/16/2019, 2:58 AMval spec = "/organization" / Path.of("id") meta {
but i can’t seem to be able to do:
val spec = "/organization" / Path.of("id") / "/workspaces" meta {
Is there a different way to do that?davidasync
05/17/2019, 2:42 AMQ. Does http4k support an Async model? I need webscale!
A. Not at the moment. Adding Async support is a decision that we are thinking about carefully so that we don't end up complicating the API. When we do add it, it'll probably use co-routines and they're still marked as experimental which is another reason we are holding off. As for the scaling arguments, see the above answer relating to production usage.
But I'm seeing this library also support
- Apache sync + async HTTP
- Jetty HTTP (supports sync and async HTTP)
- OkHttp HTTP (supports sync and async HTTP)
- Java (bundled with http4k-core)
Which mean support async model, isnt it ?Nezteb
05/17/2019, 8:45 PMPath.of("something")
and a url is hit like /api/users/<something>
when i receive the value is it already url decoded? i.e spaces changed from %20
to just
Razi Kheir
05/22/2019, 12:27 AMfredrik.nordin
05/23/2019, 8:48 AMdave
05/29/2019, 4:27 AM