Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: finagle/finch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.0
Choose a base ref
...
head repository: finagle/finch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jan 13, 2019

  1. Setting version to 0.28.0-SNAPSHOT

    Finch CI committed Jan 13, 2019
    Copy the full SHA
    b9d7320 View commit details

Commits on Jan 15, 2019

  1. Remove asyncBody

    vkostyukov committed Jan 15, 2019
    Copy the full SHA
    cf79fce View commit details
  2. Merge pull request #1069 from finagle/vk/remove-async-stream

    Remove asyncBody
    vkostyukov authored Jan 15, 2019
    Copy the full SHA
    cf7372d View commit details

Commits on Jan 17, 2019

  1. Copy the full SHA
    8696710 View commit details
  2. Copy the full SHA
    fc7726a View commit details
  3. Merge pull request #1072 from finagle/vk/iteratee-cleanup

    Remove deprecated iteratee names
    vkostyukov authored Jan 17, 2019
    Copy the full SHA
    472953f View commit details

Commits on Jan 19, 2019

  1. Copy the full SHA
    ec5112c View commit details
  2. Merge pull request #1074 from scala-steward/update/refined-0.9.4

    Update refined, refined-cats, ... to 0.9.4
    vkostyukov authored Jan 19, 2019
    Copy the full SHA
    928ac4d View commit details

Commits on Jan 22, 2019

  1. Copy the full SHA
    88c2dc3 View commit details
  2. Merge pull request #1075 from scala-steward/update/cats-effect-1.2.0

    Update cats-effect to 1.2.0
    vkostyukov authored Jan 22, 2019
    Copy the full SHA
    7c89362 View commit details

Commits on Jan 25, 2019

  1. Copy the full SHA
    fd311db View commit details
  2. Merge pull request #1073 from finagle/vk/io-to-response

    Do not run stream out of band
    vkostyukov authored Jan 25, 2019
    Copy the full SHA
    f34c09e View commit details
  3. fixed typo

    ryuta.sakamoto committed Jan 25, 2019
    Copy the full SHA
    ba5c647 View commit details
  4. Merge pull request #1077 from gonta/fix-broken-links

    fixed typo
    vkostyukov authored Jan 25, 2019
    Copy the full SHA
    5d12ab3 View commit details

Commits on Jan 26, 2019

  1. Copy the full SHA
    3fc90e6 View commit details
  2. Merge pull request #1079 from scala-steward/update/discipline-0.11.0

    Update discipline to 0.11.0
    vkostyukov authored Jan 26, 2019
    Copy the full SHA
    5cbb3d7 View commit details
  3. Copy the full SHA
    096903b View commit details
  4. Merge pull request #1081 from scala-steward/update/fs2-core-1.0.3

    Update fs2-core to 1.0.3
    vkostyukov authored Jan 26, 2019
    Copy the full SHA
    e8d83d5 View commit details

Commits on Jan 29, 2019

  1. Introduce Endpoint.Compiled, a Kleisli middleware (#1080)

    * Introduce effect-aware Filter[F] and Service[F]
    
    * revert conformHttp call
    
    * Rename Service[F] to EndpointCompiled[F] and revert Bootstrap.toService
    
    * Fix formatting
    
    * Remove Filter and replace EndpointCompiled with Kleisli type alias
    
    * Add CompiledOps
    
    * Change Endpoint.Compiled signature to Either
    
    * Add Endpoint.compile(As)
    
    * Change BootstrapSpec to use compile method
    
    * Add exception attempt test case
    
    * Change deprecation message
    
    * Use Id as default F type for Bootstrap
    
    * Move trace capture under toService and undeprecate capture
    
    * Remove implicit toService in favor of ToService case class and Endpoint.toService
    sergeykolbasov authored Jan 29, 2019
    Copy the full SHA
    a3a58de View commit details

Commits on Feb 1, 2019

  1. Copy the full SHA
    e074ef9 View commit details
  2. Merge pull request #1084 from scala-steward/update/cats-core-1.6.0

    Update cats-core, cats-laws to 1.6.0
    vkostyukov authored Feb 1, 2019
    Copy the full SHA
    1e5a10e View commit details

Commits on Feb 3, 2019

  1. Update user-guide.md

    Remove the `headerExists` and `paramExists` from the documentation
    FabioPinheiro committed Feb 3, 2019
    Copy the full SHA
    35ff5d4 View commit details

Commits on Feb 4, 2019

  1. Merge pull request #1085 from FabioPinheiro/master

    Cleanup user-guide.md
    vkostyukov authored Feb 4, 2019
    Copy the full SHA
    065e600 View commit details

Commits on Feb 22, 2019

  1. Copy the full SHA
    6fc8fbc View commit details
  2. Merge pull request #1088 from scala-steward/update/finagle-http-19.2.0

    Update finagle-http, finagle-stats, ... to 19.2.0
    vkostyukov authored Feb 22, 2019
    Copy the full SHA
    3d231cf View commit details

Commits on Feb 25, 2019

  1. Example on using Endpoint.Compiled (#1083)

    * Example on using Endpoint.Compiled
    
    * Update examples according to comments
    sergeykolbasov authored Feb 25, 2019
    Copy the full SHA
    14e2cd6 View commit details

Commits on Feb 26, 2019

  1. Least powerful type classes + Endpoint.mapF (#1089)

    * Least powerful type classes + Endpoint.mapF
    
    * Fix compilation
    
    * Add mapF scaladoc
    
    * Rename mapF to transformF
    sergeykolbasov authored Feb 26, 2019
    Copy the full SHA
    21b143b View commit details

Commits on Feb 27, 2019

  1. Copy the full SHA
    2f2f98e View commit details
  2. Release 0.28.0

    sergeykolbasov authored Feb 27, 2019
    Copy the full SHA
    18dbd97 View commit details
  3. Setting version to 0.28.0

    Finch CI committed Feb 27, 2019
    Copy the full SHA
    49771ea View commit details
  4. Setting version to 0.29.0-SNAPSHOT

    Finch CI committed Feb 27, 2019
    Copy the full SHA
    c317ac6 View commit details

Commits on Feb 28, 2019

  1. Copy the full SHA
    cf0473d View commit details

Commits on Mar 1, 2019

  1. Copy the full SHA
    7e6179a View commit details
  2. Merge pull request #1093 from scala-steward/update/scalatest-3.0.6

    Update scalatest to 3.0.6
    vkostyukov authored Mar 1, 2019
    Copy the full SHA
    a7612a1 View commit details
  3. Copy the full SHA
    5080dc6 View commit details
  4. Merge pull request #1095 from scala-steward/update/fs2-core-1.0.4

    Update fs2-core to 1.0.4
    vkostyukov authored Mar 1, 2019
    Copy the full SHA
    b1859e0 View commit details

Commits on Mar 4, 2019

  1. Fs2 EncodeStream for both ConcurrentEffect and Effect monads

    The `ConcurrentEffect` instances are prioritized higher.
    This means users can benefit from cancellation when possible
    without loss of generality.
    joroKr21 committed Mar 4, 2019
    Copy the full SHA
    71c006a View commit details
  2. Replace references to deprecated GeneratorDrivenPropertyChecks

    Deprecated since scalatest 3.0.6
    
    The drop-in replacement is `ScalaCheckDrivenPropertyChecks`.
    joroKr21 committed Mar 4, 2019
    Copy the full SHA
    6cc3283 View commit details

Commits on Mar 7, 2019

  1. Merge pull request #1094 from finagle/vk/transform-output

    Deprecate transform in favor of transformOutput
    vkostyukov authored Mar 7, 2019
    Copy the full SHA
    f3d374c View commit details

Commits on Mar 9, 2019

  1. Copy the full SHA
    c605073 View commit details
  2. Merge pull request #1099 from akiomik/patch-2

    Fix link for fs2 in README.md
    vkostyukov authored Mar 9, 2019
    Copy the full SHA
    ade9b10 View commit details

Commits on Mar 13, 2019

  1. Merge pull request #1082 from joroKr21/encode-stream-concurrent

    Fs2 EncodeStream for both ConcurrentEffect and Effect monads
    vkostyukov authored Mar 13, 2019
    Copy the full SHA
    4f6a52a View commit details

Commits on Mar 14, 2019

  1. Copy the full SHA
    c1177c3 View commit details
  2. Merge pull request #1100 from scala-steward/update/finagle-http-19.3.0

    Update finagle-http, finagle-stats, ... to 19.3.0
    vkostyukov authored Mar 14, 2019
    Copy the full SHA
    d645f1b View commit details

Commits on Mar 19, 2019

  1. Copy the full SHA
    54f2832 View commit details

Commits on Mar 21, 2019

  1. Copy the full SHA
    624d1b5 View commit details

Commits on Mar 24, 2019

  1. Merge pull request #1101 from scala-steward/update/scalatest-3.0.7

    Update scalatest to 3.0.7
    vkostyukov authored Mar 24, 2019
    Copy the full SHA
    0f2476a View commit details
  2. Merge pull request #1096 from joroKr21/scalatest-prop

    Replace references to deprecated GeneratorDrivenPropertyChecks
    vkostyukov authored Mar 24, 2019
    Copy the full SHA
    949c664 View commit details
  3. Merge pull request #1102 from scala-steward/update/argonaut-6.2.3

    Update argonaut to 6.2.3
    vkostyukov authored Mar 24, 2019
    Copy the full SHA
    2710d69 View commit details

Commits on Mar 27, 2019

  1. Update sbt-jmh to 0.3.5

    scala-steward committed Mar 27, 2019
    Copy the full SHA
    5d2a601 View commit details
Showing with 3,782 additions and 4,759 deletions.
  1. +8 −0 .git-blame-ignore-revs
  2. +33 −0 .github/workflows/build.yml
  3. +6 −0 .gitignore
  4. 0 .scala-steward.conf
  5. +7 −0 .scalafix.conf
  6. +12 −0 .scalafmt.conf
  7. +0 −21 .travis.yml
  8. +2 −2 CONTRIBUTING.md
  9. +17 −24 README.md
  10. +4 −7 argonaut/src/main/scala/io/finch/argonaut/Decoders.scala
  11. +1 −3 argonaut/src/main/scala/io/finch/argonaut/Encoders.scala
  12. +2 −6 argonaut/src/main/scala/io/finch/argonaut/package.scala
  13. +1 −1 argonaut/src/test/scala/io/finch/argonaut/ArgonautSpec.scala
  14. +46 −49 benchmarks/src/main/scala/io/finch/benchmarks.scala
  15. +1 −1 benchmarks/src/main/scala/io/finch/data/Foo.scala
  16. +131 −112 build.sbt
  17. +23 −10 build/build.sh
  18. BIN build/credentials.sbt.enc
  19. BIN build/deploy_key.pem.enc
  20. BIN build/pubring.gpg.enc
  21. BIN build/secring.gpg.enc
  22. +23 −34 circe/src/main/scala/io/finch/circe/AccumulatingDecoders.scala
  23. +9 −0 circe/src/main/scala/io/finch/circe/CirceError.scala
  24. +26 −45 circe/src/main/scala/io/finch/circe/Decoders.scala
  25. +3 −4 circe/src/main/scala/io/finch/circe/Encoders.scala
  26. +5 −9 circe/src/main/scala/io/finch/circe/package.scala
  27. +2 −2 circe/src/test/scala/io/finch/circe/test/CirceSpec.scala
  28. +25 −22 core/src/main/scala/io/finch/Accept.scala
  29. +113 −62 core/src/main/scala/io/finch/Bootstrap.scala
  30. +99 −0 core/src/main/scala/io/finch/Compile.scala
  31. +16 −24 core/src/main/scala/io/finch/Decode.scala
  32. +31 −28 core/src/main/scala/io/finch/DecodeEntity.scala
  33. +7 −6 core/src/main/scala/io/finch/DecodePath.scala
  34. +6 −10 core/src/main/scala/io/finch/DecodeStream.scala
  35. +6 −8 core/src/main/scala/io/finch/Encode.scala
  36. +8 −11 core/src/main/scala/io/finch/EncodeStream.scala
  37. +523 −766 core/src/main/scala/io/finch/Endpoint.scala
  38. +198 −273 core/src/main/scala/io/finch/EndpointModule.scala
  39. +42 −67 core/src/main/scala/io/finch/EndpointResult.scala
  40. +47 −64 core/src/main/scala/io/finch/Error.scala
  41. +69 −107 core/src/main/scala/io/finch/Input.scala
  42. +1 −3 core/src/main/scala/io/finch/LiftReader.scala
  43. +19 −0 core/src/main/scala/io/finch/LowPriorityEndpointInstances.scala
  44. +94 −118 core/src/main/scala/io/finch/Output.scala
  45. +27 −27 core/src/main/scala/io/finch/Outputs.scala
  46. +34 −0 core/src/main/scala/io/finch/ServerSentEvent.scala
  47. +88 −117 core/src/main/scala/io/finch/ToResponse.scala
  48. +14 −145 core/src/main/scala/io/finch/ToService.scala
  49. +34 −39 core/src/main/scala/io/finch/Trace.scala
  50. +0 −88 core/src/main/scala/io/finch/ValidationRule.scala
  51. +0 −27 core/src/main/scala/io/finch/ValidationRules.scala
  52. +8 −8 core/src/main/scala/io/finch/contentTypes.scala
  53. +44 −46 core/src/main/scala/io/finch/endpoint/body.scala
  54. +6 −7 core/src/main/scala/io/finch/endpoint/cookie.scala
  55. +28 −32 core/src/main/scala/io/finch/endpoint/endpoint.scala
  56. +14 −14 core/src/main/scala/io/finch/endpoint/header.scala
  57. +6 −5 core/src/main/scala/io/finch/endpoint/method.scala
  58. +26 −33 core/src/main/scala/io/finch/endpoint/multipart.scala
  59. +23 −26 core/src/main/scala/io/finch/endpoint/param.scala
  60. +20 −18 core/src/main/scala/io/finch/endpoint/path.scala
  61. +62 −72 core/src/main/scala/io/finch/internal/Mapper.scala
  62. +10 −12 core/src/main/scala/io/finch/internal/PairJoin.scala
  63. +0 −36 core/src/main/scala/io/finch/internal/ToEffect.scala
  64. +2 −5 core/src/main/scala/io/finch/internal/currentTime.scala
  65. +27 −0 core/src/main/scala/io/finch/internal/newLine.scala
  66. +40 −39 core/src/main/scala/io/finch/internal/package.scala
  67. +2 −17 core/src/main/scala/io/finch/package.scala
  68. +22 −27 core/src/test/scala/io/finch/BodySpec.scala
  69. +65 −68 core/src/test/scala/io/finch/BootstrapSpec.scala
  70. +2 −3 core/src/test/scala/io/finch/DecodeEntityLaws.scala
  71. +3 −1 core/src/test/scala/io/finch/DecodeEntitySpec.scala
  72. +2 −3 core/src/test/scala/io/finch/DecodePathLaws.scala
  73. +3 −1 core/src/test/scala/io/finch/DecodePathSpec.scala
  74. +19 −0 core/src/test/scala/io/finch/Dispatchers.scala
  75. +4 −5 core/src/test/scala/io/finch/EncodeLaws.scala
  76. +7 −9 core/src/test/scala/io/finch/EncodeSpec.scala
  77. +110 −77 core/src/test/scala/io/finch/EndToEndSpec.scala
  78. +153 −138 core/src/test/scala/io/finch/EndpointSpec.scala
  79. +19 −20 core/src/test/scala/io/finch/EntityEndpointLaws.scala
  80. +3 −5 core/src/test/scala/io/finch/EvaluatingEndpointLaws.scala
  81. +19 −14 core/src/test/scala/io/finch/ExtractPathLaws.scala
  82. +156 −144 core/src/test/scala/io/finch/FinchSpec.scala
  83. +19 −18 core/src/test/scala/io/finch/HeaderSpec.scala
  84. +27 −29 core/src/test/scala/io/finch/InputSpec.scala
  85. +44 −149 core/src/test/scala/io/finch/MethodSpec.scala
  86. +0 −21 core/src/test/scala/io/finch/MissingInstances.scala
  87. +35 −51 core/src/test/scala/io/finch/MultipartSpec.scala
  88. +29 −52 core/src/test/scala/io/finch/OutputSpec.scala
  89. +23 −20 core/src/test/scala/io/finch/ParamSpec.scala
  90. +40 −28 {sse/src/test/scala/io/finch/sse → core/src/test/scala/io/finch}/ServerSentEventSpec.scala
  91. +33 −40 core/src/test/scala/io/finch/StreamingLaws.scala
  92. +17 −0 core/src/test/scala/io/finch/TestInstances.scala
  93. +0 −21 core/src/test/scala/io/finch/ToResponseSpec.scala
  94. +6 −7 core/src/test/scala/io/finch/TraceSpec.scala
  95. +4 −7 core/src/test/scala/io/finch/data/Foo.scala
  96. +7 −9 core/src/test/scala/io/finch/internal/HttpContentSpec.scala
  97. +13 −5 core/src/test/scala/io/finch/internal/HttpMessageSpec.scala
  98. +0 −43 core/src/test/scala/io/finch/internal/ToEffectLaws.scala
  99. +0 −22 core/src/test/scala/io/finch/internal/ToEffectSpec.scala
  100. +4 −3 core/src/test/scala/io/finch/internal/TooFastStringSpec.scala
  101. +19 −18 docs/{src/main/tut → mdoc}/best-practices.md
  102. +0 −1 docs/{src/main/tut → mdoc}/contributing.md
  103. +52 −77 docs/{src/main/tut → mdoc}/cookbook.md
  104. +8 −11 docs/{src/main/tut → mdoc}/index.md
  105. +112 −98 docs/{src/main/tut → mdoc}/user-guide.md
  106. +22 −24 examples/src/main/scala/io/finch/div/Main.scala
  107. +14 −20 examples/src/main/scala/io/finch/iteratee/Main.scala
  108. +53 −0 examples/src/main/scala/io/finch/middleware/Main.scala
  109. +0 −100 examples/src/main/scala/io/finch/streaming/Main.scala
  110. +11 −21 examples/src/main/scala/io/finch/todo/App.scala
  111. +44 −46 examples/src/main/scala/io/finch/todo/Main.scala
  112. +29 −25 examples/src/main/scala/io/finch/wrk/Finagle.scala
  113. +15 −15 examples/src/main/scala/io/finch/wrk/Finch.scala
  114. +4 −11 examples/src/main/scala/io/finch/wrk/Wrk.scala
  115. +10 −6 examples/src/test/scala/io/finch/div/DivSpec.scala
  116. +0 −41 examples/src/test/scala/io/finch/streaming/StreamingSpec.scala
  117. +19 −29 examples/src/test/scala/io/finch/todo/TodoSpec.scala
  118. +57 −45 fs2/src/main/scala/io/finch/fs2/package.scala
  119. +11 −9 fs2/src/test/scala/io/finch/fs2/Fs2StreamingSpec.scala
  120. +24 −24 generic/src/main/scala/io/finch/generic/FromParams.scala
  121. +4 −4 generic/src/main/scala/io/finch/generic/GenericDerivation.scala
  122. +5 −5 generic/src/main/scala/io/finch/generic/package.scala
  123. +17 −13 generic/src/test/scala/io/finch/generic/DerivedEndpointLaws.scala
  124. +9 −10 generic/src/test/scala/io/finch/generic/GenericSpec.scala
  125. +40 −78 iteratee/src/main/scala/io/finch/iteratee/package.scala
  126. +9 −8 iteratee/src/test/scala/io/finch/iteratee/IterateeStreamingSpec.scala
  127. +25 −22 json-test/src/main/scala/io/finch/test/AbstractJsonSpec.scala
  128. +34 −35 json-test/src/main/scala/io/finch/test/JsonLaws.scala
  129. +10 −3 json-test/src/main/scala/io/finch/test/data/ExampleNestedCaseClass.scala
  130. +1 −1 project/build.properties
  131. +14 −11 project/plugins.sbt
  132. +1 −1 refined/src/main/scala/io/finch/refined/PredicateFailed.scala
  133. +4 −12 refined/src/main/scala/io/finch/refined/package.scala
  134. +2 −4 refined/src/test/scala/io/finch/refined/DecodeEntityRefinedSpec.scala
  135. +2 −3 refined/src/test/scala/io/finch/refined/DecodePathRefinedSpec.scala
  136. +5 −7 refined/src/test/scala/io/finch/refined/PredicateFailedSpec.scala
  137. +0 −85 scalastyle-config.xml
  138. +0 −39 sse/src/main/scala/io/finch/sse/ServerSentEvent.scala
  139. +11 −18 test/src/main/scala/io/finch/test/ServiceIntegrationSuite.scala
  140. +15 −26 test/src/main/scala/io/finch/test/ServiceSuite.scala
  141. +1 −1 version.sbt
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Scala Steward: Reformat with scalafmt 3.5.8
699c16e7a245b2ffee1ba4de9bfd1093a3d5072f

# Scala Steward: Reformat with scalafmt 3.8.4
cc2327d46a560d51bfc6d0e417dacd42fe8a8578

# Scala Steward: Reformat with scalafmt 3.8.6
19f7c988f7aa16ab4154220681c654526116afa9
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Scala CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: ['adopt@1.11']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: set up sbt and java
uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}
- name: Run tests
shell: bash
env:
ENCRYPTION_PASSWORD: ${{secrets.ENCRYPTION_PASSWORD}}
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
run: ./build/build.sh
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ target/
.project
.classpath
local.*

.bloop
.metals
.vscode
project/metals.sbt
project/project
Empty file added .scala-steward.conf
Empty file.
7 changes: 7 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OrganizeImports {
groupedImports = Keep
removeUnused = true
}
rules = [
OrganizeImports
]
12 changes: 12 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version = 3.9.3
maxColumn = 160
align.preset = some
runner.dialect = scala213
rewrite.rules = [
RedundantBraces,
RedundantParens,
SortModifiers,
PreferCurlyFors
]
assumeStandardLibraryStripMargin = true
optIn.breakChainOnFirstMethodDot = false
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -17,12 +17,12 @@ _contributing process_ looks as follows:
Finch follows the [Effective Scala][1] code style guide. When in doubt, look around the codebase and see how it's done
elsewhere.

* Code and comments should be formatted to a width no greater than 120 columns
* Code and comments should be formatted to a width no greater than 160 columns
* Files should be exempt of trailing spaces
* Each abstraction with corresponding implementations should live in its own Scala file, i.e `Endpoint.scala`
* Each implicit conversion (if possible) should be defined in the corresponding companion object

That said, the Scala style checker `sbt scalastyle` should pass on the code.
That said, the Scala source code shall be formatted with `sbt fmt`

## Write Tests
Finch uses both [ScalaTest][2] and [ScalaCheck][3] with the following settings:
41 changes: 17 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ close as possible to the bare metal Finagle API.

Badges
------
[![Build Status](https://img.shields.io/travis/finagle/finch/master.svg)](https://travis-ci.org/finagle/finch)
[![Scala CI](https://github.com/finagle/finch/actions/workflows/build.yml/badge.svg)](https://github.com/finagle/finch/actions/workflows/build.yml)
[![Coverage Status](https://img.shields.io/codecov/c/github/finagle/finch/master.svg)](https://codecov.io/github/finagle/finch)
[![Gitter](https://img.shields.io/badge/gitter-join%20chat-green.svg)](https://gitter.im/finagle/finch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.finagle/finch-core_2.11.svg)](https://index.scala-lang.org/finagle/finch/finch-core)
@@ -22,10 +22,9 @@ Finch uses multi-project structure and contains of the following _modules_:
* [`finch-argonaut`](argonaut) - [Argonaut][argonaut] + Finch
* [`finch-circe`](circe) - [Circe][circe] + Finch
* [`finch-iteratee`](iteratee) - [Iteratee][iteratee] + Finch
* [`finch-fs2`](fs2) - [FS2][fs] + Finch
* [`finch-fs2`](fs2) - [FS2][fs2] + Finch
* [`finch-refined`](refined) - [Refined][refined] + Finch
* [`finch-test`](test) - the test support classes/functions
* [`finch-sse`](sse) - SSE ([Server Sent Events][server-sent-events]) support in Finch

Additional Modules
------------------
@@ -37,7 +36,7 @@ reach out if you need published artifacts):
* [`finch-json4s`][finch-json4s] - [JSON4s][json4s] + Finch
* [`finch-playjson`][finch-playjson] - [PlayJson][playjson] + Finch
* [`finch-sprayjson`][finch-sprayjson] - [SprayJson][sprayjson] + Finch
* [`finch-oauth2`](finch-oath2) - [Finagle OAuth2](finagle-oauth2) + Finch
* [`finch-oauth2`][finch-oauth2] - [Finagle OAuth2][finagle-oauth2] + Finch

Installation
------------
@@ -49,26 +48,19 @@ libraryDependencies ++= Seq(
)
```

Cats Effect and Twitter Futures
-------------------------------

Starting with 0.25, Finch artifacts are published for both Twitter Futures (`Endpoint[A]`) and
Cats Effects (`Endpoint[F[_], A]`):

- Use `finch-*` artifacts for endpoints locked in Twitter Futures (legacy)
- Use `finchx-*` artifacts for polymorphic endpoints (recommended)

Hello World!
------------
This "Hello World!" example is built with just `finchx-core` (polymorphic endpoints):
This "Hello World!" example is built with just `finch-core`:

```scala
import io.finch._, cats.effect.IO
import com.twitter.finagle.Http

object Main extends App with Endpoint.Module[IO] {
val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
Http.server.serve(":8080", api.toServiceAs[Text.Plain])
import cats.effect.{IO, IOApp}
import io.finch._

object Main extends IOApp.Simple with Endpoint.Module[IO] {
override def run: IO[Unit] = {
val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
Bootstrap[IO].serve[Text.Plain](api).listen(":8080").useForever
}
}
```

@@ -111,6 +103,7 @@ Documentation

Adopters
--------
* [PITS Global Data Recovery Services](https://www.pitsdatarecovery.net/)
* [Despegar](http://www.despegar.com)
* [Earnest](http://meetearnest.com)
* [Globo.com](http://globo.com)
@@ -125,7 +118,7 @@ Adopters
* [QuizUp](http://www.quizup.com)
* [Lookout](http://www.lookout.com)
* [Project September](http://projectseptember.com/)
* [Sigma](http://thesigma.com)
* [Merit](https://merits.com)
* [D.A.Consortium](http://www.dac.co.jp/english/)
* [Redbubble](https://redbubble.com/)
* [Zalando](https://zalando.de)
@@ -144,6 +137,7 @@ Related Projects
* [Finch Rich](https://github.com/akozhemiakin/finchrich): Macro-based controllers for Finch
* [Finch Quickstart](https://github.com/zdavep/finch-quickstart): A skeleton Finch project
* [Finch OAuth2](https://github.com/finch/finch-oauth2): the OAuth2 support backed by the [finagle-oauth2][finagle-oauth2] library
* [Finch Todo Backend](https://github.com/ilya-murzinov/finch-todo-backend): Finch implementation of [todobackend](http://www.todobackend.com/)

Contributing
------------
@@ -175,7 +169,7 @@ limitations under the License.
[gitter]: https://gitter.im/finagle/finch
[finagle]: https://github.com/twitter/finagle
[circe]: https://github.com/circe/circe
[jackson]: http://wiki.fasterxml.com/JacksonHome
[jackson]: https://github.com/FasterXML/jackson
[argonaut]: http://argonaut.io
[finagle-oauth2]: https://github.com/finagle/finagle-oauth2
[json4s]: http://json4s.org
@@ -197,9 +191,8 @@ limitations under the License.
[finch-json4s]: https://github.com/finch/finch-json4s
[finch-sprayjson]: https://github.com/finch/finch-sprayjson
[finch-playjson]: https://github.com/finch/finch-playjson
[finch-oauth2]: https://github.com/finch/finch-ouath2
[finch-oauth2]: https://github.com/finch/finch-oauth2
[fs2]: https://github.com/functional-streams-for-scala/fs2
[server-sent-events]: https://en.wikipedia.org/wiki/Server-sent_events
[vkostyukov]: https://twitter.com/vkostyukov
[travisbrown]: https://twitter.com/travisbrown
[ryan_plessner]: https://twitter.com/ryan_plessner
11 changes: 4 additions & 7 deletions argonaut/src/main/scala/io/finch/argonaut/Decoders.scala
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
package io.finch.argonaut

import argonaut._
import argonaut.DecodeJson
import cats.syntax.either._
import io.finch._
import io.finch.Decode
import io.finch.internal.HttpContent

trait Decoders {

/**
* Maps Argonaut's [[DecodeJson]] to Finch's [[Decode]].
*/
/** Maps Argonaut's [[argonaut.DecodeJson]] to Finch's [[Decode]]. */
implicit def decodeArgonaut[A](implicit d: DecodeJson[A]): Decode.Json[A] =
Decode.json { (b, cs) =>
Parse.parse(b.asString(cs)).flatMap(_.as[A].result.leftMap(_._1)) match {
case Right(result) => Right(result)
case Left(error) => Left(new Exception(error))
case Left(error) => Left(new Exception(error))
}
}
}
}
4 changes: 1 addition & 3 deletions argonaut/src/main/scala/io/finch/argonaut/Encoders.scala
Original file line number Diff line number Diff line change
@@ -8,9 +8,7 @@ trait Encoders {

protected def printer: PrettyParams

/**
* Maps Argonaut's [[EncodeJson]] to Finch's [[Encode]].
*/
/** Maps Argonaut's [[argonaut.EncodeJson]] to Finch's [[Encode]]. */
implicit def encodeArgonaut[A](implicit e: EncodeJson[A]): Encode.Json[A] =
Encode.json((a, cs) => Buf.ByteArray.Owned(printer.pretty(e.encode(a)).getBytes(cs.name)))
}
8 changes: 2 additions & 6 deletions argonaut/src/main/scala/io/finch/argonaut/package.scala
Original file line number Diff line number Diff line change
@@ -10,16 +10,12 @@ package object argonaut extends Encoders with Decoders {
override protected val printer: PrettyParams = PrettyParams.nospace.copy(dropNullKeys = true)
}

/**
* Provides an implicit [[PrettyParams]] that preserves order of the JSON fields.
*/
/** Provides an implicit [[_root_.argonaut.PrettyParams]] that preserves order of the JSON fields. */
object preserveOrder extends Encoders with Decoders {
override protected val printer: PrettyParams = PrettyParams.nospace.copy(preserveOrder = true)
}

/**
* Provides an implicit [[PrettyParams]] that both preserves order of the JSON fields and drop null keys.
*/
/** Provides an implicit [[_root_.argonaut.PrettyParams]] that both preserves order of the JSON fields and drop null keys. */
object preserveOrderAndDropNullKeys extends Encoders with Decoders {
override protected val printer: PrettyParams = PrettyParams.nospace.copy(preserveOrder = true, dropNullKeys = true)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.finch.argonaut

import argonaut._
import argonaut.Argonaut._
import argonaut._
import io.finch.test.AbstractJsonSpec
import io.finch.test.data._

Loading