-
I'm experimenting, so apologies if this question is naive. I'm expanding on the website examples, in this case to have 2 smithy services. In addition to the "hello" service, I've written out a simple Now, I'd like to turn it into an http4s server.
This compiles and runs, but has a couple of fairly severe downsides.
So the key question would be whether I am doing something am I doing something that is obviously "wrong" trying to "combine" these routes / docs in this manner? Is the intent to have "one smithy service per http server"? This looks like the obvious solution to all the above :-)... but I want to make sure I'm not doing something silly? The full example is here, in case the question is poorly formed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey there, those are pretty good question. Also, thanks for accompanying them with a repo, it greatly helps formulate an answer. 1. Why are the todo routes not working ?It's because your See the instance for `SemigroupK[Either[E, *]] So your allRoutes value should look like : val allRoutes = (helloRoutes, todoRoutes).mapN(_ <+> _ ).map(_ <+> docHelloRoutes <+> docTodoRoutes).map(_.orNotFound) 2. Why do the docs UX suck when there's more than one serviceWell, we're very aware of this. There's an open issue to make it better, but also we're currently facing a bigger problem that the latest swagger-ui doesn't work anymore with how we use it. See this release. So the whole swagger-ui is bound to receive an overhaul in the near future, and when it does we'll kill two birds in one stone and make it work with several service definitions. |
Beta Was this translation helpful? Give feedback.
Hey there, those are pretty good question. Also, thanks for accompanying them with a repo, it greatly helps formulate an answer.
1. Why are the todo routes not working ?
It's because your
<+>
call is working at the level ofEither
, not at the level ofHttpRoute
. Therefore, it returns the first non-left value, as oppose to an either containing the sum of both successes.See the instance for `SemigroupK[Either[E, *]]
So your allRoutes value should look like :
2. Why do the docs UX suck when there's more than one service
Well, we're very aware of this. There's an open issue …