Skip to content

Finch.io 0.1.4

Compare
Choose a tag to compare
@vkostyukov vkostyukov released this 31 Jul 16:59
· 2173 commits to master since this release

This release are mostly about request reader:

  • There are only async readers in Finch.io (no country for Param, only RequiredParam and OptionalParam, only hard-core)
  • New request reader that reads constant value: ConstParam() (useful for passing URI params)
  • Headers may be fetched with RequiredHeader and OptionalHeader readers

So, all the things are build around common interface of RequestReader, which means everything may be composed in a single for-comprehension chain:

val magic = for {
  a <- RequiredParam("a")
  b <- OptionalParam("b")
  c <- RequiredHeader("c")
  d <- ConstParam(10)
  _ <- ValidationRule("d", "should be 10") { d == 10 }
} yield Seq(a, b, c, d)

Enjoy!