# Exposing Handler in zio-http

**URL:** <https://softwaremill.community/t/exposing-handler-in-zio-http/185>\
**Category:** tapir\
**Created:** [April 12, 2023, 1:01pm UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185 "2023-04-12T13:01:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ex0ns](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/ex0ns/32/18_2.png) [@ex0ns](https://softwaremill.community/u/ex0ns)\
**Post date:** [April 12, 2023, 1:01pm UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185/1 "2023-04-12T13:01:00Z")

</div>

I was wondering the motivation behind exposing an HttpApp only in the ZioHttpInterpreter and not a `Handler` version as well (which is already existing as an inner method [tapir/ZioHttpInterpreter.scala at bc77e64c266c2c1eb9adc8f9281fb5327140a44e · softwaremill/tapir · GitHub](https://github.com/softwaremill/tapir/blob/bc77e64c266c2c1eb9adc8f9281fb5327140a44e/server/zio-http-server/src/main/scala/sttp/tapir/server/ziohttp/ZioHttpInterpreter.scala#L29))

I know that zio-http went into a lot of refactoring and breaking changes recently, so I would not mind opening a PR to add that to tapir, but I wanted to know if there was a reason for that first ?

My idea behind that is that Handler are a bit more composable than Http (we have a Flatmap on them), and that it could be worth exposing a way to retrieve handler from Tapir.

WDYT ?

---

<div class="post-metadata">

**Author:** ![adamw](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/adamw/32/28_2.png) [@adamw](https://softwaremill.community/u/adamw)\
**Post date:** [April 12, 2023, 2:57pm UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185/2 "2023-04-12T14:57:51Z")

</div>

There’s no reason that I’d be aware of. Probably it was just created this way 🙂 If there’s a more general concept that we could interpret into - let’s do that. Either as a replacement, or as a complementary API.

---

<div class="post-metadata">

**Author:** ![ex0ns](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/ex0ns/32/18_2.png) [@ex0ns](https://softwaremill.community/u/ex0ns)\
**Post date:** [April 18, 2023, 10:44am UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185/3 "2023-04-18T10:44:46Z")

</div>

Ok thanks, I will either wait or work on the upgrade to the zio-http 3.0 release candidate and might introduce another method on tapir to retrieve an Handler instead, however they fixed the application of middleware in zio-http and we can now apply Handler middleware on HttpApp so there is less need for such a method yet

---

<div class="post-metadata">

**Author:** ![adamw](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/adamw/32/28_2.png) [@adamw](https://softwaremill.community/u/adamw)\
**Post date:** [April 18, 2023, 10:59am UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185/4 "2023-04-18T10:59:44Z")

</div>

Yes, we need somebody to migrate to latest zio-http 🙂 See also: [[BUG] ZioHttpInterpreter constructor fails at runtime (for zio-http 3.0.0-RC1) · Issue #2846 · softwaremill/tapir · GitHub](https://github.com/softwaremill/tapir/issues/2846)

---

<div class="post-metadata">

**Author:** ![adamw](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/adamw/32/28_2.png) [@adamw](https://softwaremill.community/u/adamw)\
**Post date:** [April 25, 2023, 12:43pm UTC](https://softwaremill.community/t/exposing-handler-in-zio-http/185/5 "2023-04-25T12:43:06Z")

</div>

A release supporting zio-http 3.0.0-RC1 is now available: [Release v1.2.13 · softwaremill/tapir · GitHub](https://github.com/softwaremill/tapir/releases/tag/v1.2.13)

If you think the integration would need some adjustments, it would be great to capture these as an issue or PR - thanks 🙂
