Codecraig
01/04/2019, 1:57 PM/status/{id}
so you can do GET /status/abc-123 ...looking at https://www.http4k.org/cookbook/nestable_routes/ I have:
"/status/{id}" meta {
summary = "get the status"
} bindContract GET to handler
Codecraig
01/04/2019, 1:58 PMcurl <http://localhost:800/status/123>
I get a 404. If i change the route to just be :
"/status" meta {
summary = "get the status"
} bindContract GET to handler
I get a 200 Ok if I curl <http://localhost:8000/status>
What am I missing?Codecraig
01/04/2019, 2:04 PMcurl "<http://localhost:8000/status/\{id\}>"
dave
01/04/2019, 2:22 PMdave
01/04/2019, 2:22 PM"/status" / Path.of("id)
...dave
01/04/2019, 2:23 PMCodecraig
01/04/2019, 2:38 PMcontract(OpenApi(ApiInfo(...), "/docs/swagger.json", myRoute())
fun myRoute = "/status/{id}" meta { ... } bindContract GET to handler
dave
01/04/2019, 2:38 PMCodecraig
01/04/2019, 2:39 PMfun myRoute = "/status/" / Path.of("id") meta { ... } bindContract GET to handler
It not longer returns a ContractRoute which is needed by the contract(OpenApi(...))
portionCodecraig
01/04/2019, 2:39 PMPair<RouteBinder(String) -> HttpHandler>, Status>
dave
01/04/2019, 2:39 PMdave
01/04/2019, 2:40 PMto()
dave
01/04/2019, 2:41 PM... to { id -> { Response(OK).bodyString(id.toString()) }
Codecraig
01/04/2019, 2:42 PMdave
01/04/2019, 2:43 PMdarrenhobbs
01/06/2019, 8:05 PMreceiving
?dave
01/06/2019, 8:07 PMCodecraig
01/07/2019, 1:23 PMRequest
, when my current setup has `ContractRoute`'sdave
01/07/2019, 1:38 PMroute.toRouter(Root)
. We could probably make that betterer tbh..Codecraig
01/07/2019, 1:40 PMContractRoute
which doesn't have a toRouter
, what is route
in this case?dave
01/07/2019, 1:45 PMCodecraig
01/07/2019, 1:46 PMdave
01/07/2019, 2:07 PMcontract(route)
dave
01/07/2019, 2:07 PMCodecraig
01/07/2019, 2:27 PMCodecraig
01/08/2019, 12:35 PMname
and value
and a client submits an empty body...I'd like to provide a standard "error" response to them, however, my handler doesn't get invoked for me to do that (b/c the framework sees the body isn't what i expect)dave
01/08/2019, 2:10 PMmap()
chain - so Body.json().map { try to unmarshall here, and catch and rethrow the Exception }.toLens()
Codecraig
01/08/2019, 2:40 PMCodecraig
01/10/2019, 2:06 PMCodecraig
01/10/2019, 2:06 PM