Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http4s client: prefix identity with Predef #236

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ object Http4sClientGenerator {
resp.value.fold[Case](
p"case ${resp.statusCodeName}(_) => effect.pure($responseCompanionTerm.$responseTerm)"
) { _ =>
p"case ${resp.statusCodeName}(resp) => ${Term.Name(s"$methodName${resp.statusCodeName}Decoder")}.decode(resp, strict = false).fold(throw _, identity).map($responseCompanionTerm.$responseTerm)"
p"case ${resp.statusCodeName}(resp) => ${Term.Name(s"$methodName${resp.statusCodeName}Decoder")}.decode(resp, strict = false).fold(throw _, Predef.identity).map($responseCompanionTerm.$responseTerm)"
}
} :+ p"case resp => effect.raiseError(UnexpectedStatus(resp.status))"
// Get the response type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class BasicTest extends FunSuite with Matchers with SwaggerSpecRunner {
val req = Request[F](method = Method.GET, uri = Uri.unsafeFromString(host + basePath + "/baz"), headers = Headers(allHeaders))
httpClient.fetch(req)({
case Ok(resp) =>
getBazOkDecoder.decode(resp, strict = false).fold(throw _, identity).map(GetBazResponse.Ok)
getBazOkDecoder.decode(resp, strict = false).fold(throw _, Predef.identity).map(GetBazResponse.Ok)
case resp =>
effect.raiseError(UnexpectedStatus(resp.status))
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DefaultParametersTest extends FunSuite with Matchers with SwaggerSpecRunne
val req = Request[F](method = Method.GET, uri = Uri.unsafeFromString(host + basePath + "/store/order/" + Formatter.addPath(orderId) + "?" + Formatter.addArg("defparm_opt", defparmOpt) + Formatter.addArg("defparm", defparm)), headers = Headers(allHeaders))
httpClient.fetch(req)({
case Ok(resp) =>
getOrderByIdOkDecoder.decode(resp, strict = false).fold(throw _, identity).map(GetOrderByIdResponse.Ok)
getOrderByIdOkDecoder.decode(resp, strict = false).fold(throw _, Predef.identity).map(GetOrderByIdResponse.Ok)
case BadRequest(_) =>
effect.pure(GetOrderByIdResponse.BadRequest)
case NotFound(_) =>
Expand Down