Skip to content

Commit

Permalink
refactor(json): Use a non strict decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
dbousamra committed Sep 18, 2017
1 parent 558a3fb commit e56effc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object ApiResponse {
object ApiResponseUtils {

def decodeAs[A, F[_]: Monad](req: Request[F])(f: A => F[Response[F]])(implicit decoder: EntityDecoder[F, A]) = {
decoder.decode(req, strict = true).fold(
decoder.decode(req, strict = false).fold(
failure => Response[F](Status.UnprocessableEntity).withBody[ApiResponse[Nothing]](ApiResponse.failure(failure.getMessage)),
success => f(success)
).flatten
Expand Down

0 comments on commit e56effc

Please sign in to comment.