I'm considering using stac4s as a STAC client in our Scala project but boy, is it giving me a hard time. The use of cats, monads and all that fancy stuff is very daunting and there's no documentation to speak of.
I'm stuck right at the start: instantiating the thing.
import com.azavea.stac4s.api.client.SttpStacClient
import org.junit.Test
import sttp.client3._
class Stac4sTest {
@Test
def testDrive(): Unit = {
val stacClient = SttpStacClient(client = HttpURLConnectionBackend(), baseUri = uri"") // <-- error here
}
}
This gives me this compile error:
error: could not find implicit value for evidence parameter of type cats.MonadThrow[sttp.client3.Identity]
I'm assuming it's something easy like a missing import but I haven't been able to find it.
This is stac4s version 0.8.1.
Not answering this specific case but some guidance ...
When dealing with such kind of errors, I often recommend to look at the tests of the library and you'll somehow find out how to instantiate things or what import is missing.
For instance, you can start by looking at https://github.com/azavea/stac4s/blob/master/modules/client/jvm/src/test/scala/com/azavea/stac4s/api/client/SttpStacClientSpec.scala which will guide you to other classes and ultimately find what's missing.
Your IDE can help as well to suggest what's missing.