zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

API DSL

Open tusharmath opened this issue 3 years ago • 2 comments

Todos

  • [x] Customize Response headers, status code, etc. in handler
  • [ ] Add Error type
  • [ ] Refine api
  • [ ] Flesh out Doc type
  • [ ] Unify Input & Params into single type
  • [ ] Improve Client
  • [ ] Extract model into shared project so we can have a Scala.js client
  • [ ] Improve OpenAPI support
  • [ ] Expose OpenAPI from server

Performance Explorations

  • [ ] Tuple Allocation Optimizations (during Zips)
  • [ ] OrElse Optimizations (create Trie-like request parsing structure)

tusharmath avatar Apr 16 '22 06:04 tusharmath

Codecov Report

Merging #1209 (ca23a44) into main (e33f801) will decrease coverage by 6.08%. The diff coverage is 26.06%.

@@            Coverage Diff             @@
##             main    #1209      +/-   ##
==========================================
- Coverage   63.62%   57.54%   -6.09%     
==========================================
  Files          77       97      +20     
  Lines        2678     3196     +518     
  Branches       72       89      +17     
==========================================
+ Hits         1704     1839     +135     
- Misses        974     1357     +383     
Impacted Files Coverage Δ
zio-http/src/main/scala/zio/http/Client.scala 81.03% <ø> (ø)
zio-http/src/main/scala/zio/http/Http.scala 65.18% <ø> (ø)
zio-http/src/main/scala/zio/http/Patch.scala 28.57% <ø> (ø)
zio-http/src/main/scala/zio/http/Path.scala 77.96% <0.00%> (-1.35%) :arrow_down:
zio-http/src/main/scala/zio/http/Proxy.scala 100.00% <ø> (ø)
zio-http/src/main/scala/zio/http/Response.scala 84.37% <ø> (ø)
zio-http/src/main/scala/zio/http/URL.scala 82.60% <0.00%> (-1.22%) :arrow_down:
...io-http/src/main/scala/zio/http/api/APIError.scala 0.00% <0.00%> (ø)
...http/src/main/scala/zio/http/api/APIExecutor.scala 0.00% <0.00%> (ø)
...http/src/main/scala/zio/http/api/APIRegistry.scala 0.00% <0.00%> (ø)
... and 24 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Apr 16 '22 14:04 codecov-commenter

@tusharmath I added some (very basic) support for customizing headers/status codes when handling responses. There are a few ways of doing this, but I think an overload where the user simply specifies what to return in the handler is the simplest.

Next, I'm going to get zio-schema published for Scala 3 and fix the 2.12 compilation errors.

kitlangton avatar May 29 '22 17:05 kitlangton