https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

01/23/2021, 3:35 PM
@Razvan thanks! and agreed - we generally find code generators to be a massive red flag as they are often abused, and we would never ever be mandated that library users need to use them. But we are quite lazy and the extension functions did seem to be worth the effort to give people a more familiar API. 🙂 . You can (hopefully!) expect a few articles in the next few months about the connect patterns. ..
👍 1
r

Razvan

01/24/2021, 8:33 PM
If it’s possible, I’d like to see an exemple of how to make an independent lib using http4k-connect. By independent I mean that does not require the project that uses it to add the dependencies to
http4k-connect-core
&
core-fake
d

dave

01/24/2021, 8:38 PM
if you're going to extend it to create new connector library, then you will need those to hook into.
r

Razvan

01/24/2021, 8:52 PM
I saw this one. It does extend but it does not create a new stand alone lib. I agree that when you extend to add these dependencies. But I was thinking about other projects that uses a lib let’s say
http4k-connect-amazon-s3
why should he care about adding
connect-core
and
connect-fake-core
when he only needs what the lib provides. I just want the connecter to have these dependencies and not require the user to add then (unless he wants to extend)
d

dave

01/24/2021, 8:53 PM
ah - they shouldn't. there might be a problem with the dependencies.
r

Razvan

01/24/2021, 8:54 PM
the core it’s needed for Result (that it’s understandable it’s a return type), But the problem I have is with the Fake as if I don’t add the fake-core dependency it can’t figure out that ChaosFake is a HttpHandler.
d

dave

01/24/2021, 8:55 PM
we shouldn't need anything other than the particular client and fake library
so I've just removed those dependencies from the example and it still works ok. I can still resolve Result.
r

Razvan

01/24/2021, 9:00 PM
Ok I’ll try with one of the libs already inside the project, the probem was with personal lib I was trying to build and use in another project.
d

dave

01/24/2021, 9:00 PM
if you can push an example to github then we can take a look and try and see
is it an api/implementation problem with gradle?
r

Razvan

01/24/2021, 9:01 PM
Ok, I’ll do that tomorrow. thanks
Finally it was an api/implementation problem as you said. Reading the one in http4k-connect, and using the same api/implementation as in it was helpful. Now I'm fitting to understand how to manage to make two separate libs with the fake apart. but trying to apply your way is more challenging as the project structure is not the same.
d

dave

01/27/2021, 6:09 PM
yeah - it's probably easier to look at the http4k/examples repo, but I do want to make a stand alone project to make it ultra clear
4 Views