Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsBroersen committed Jan 8, 2025
1 parent 17eab14 commit e913e99
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/interop-http4s/build.sbt
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ val ZioJsonVersion = "0.1.3+8-6eb41b5a-SNAPSHOT"

lazy val zioJsonHttp4sExample = (project in file("."))
.settings(
name := "zio-json-http4s-example",
version := "1.0",
name := "zio-json-http4s-example",
version := "1.0",
scalaVersion := "2.13.5",
scalacOptions ++= Seq("-Xlint:_"),
// Only required when using a zio-json snapshot
5 changes: 3 additions & 2 deletions zio-json/shared/src/main/scala-2.x/zio/json/macros.scala
Original file line number Diff line number Diff line change
@@ -479,7 +479,7 @@ object DeriveJsonEncoder {
def join[A](ctx: CaseClass[JsonEncoder, A])(implicit config: JsonCodecConfiguration): JsonEncoder[A] =
if (ctx.parameters.isEmpty)
new JsonEncoder[A] {

override def isEmpty(a: A): Boolean = true

def unsafeEncode(a: A, indent: Option[Int], out: Write): Unit = out.write("{}")
@@ -573,7 +573,8 @@ object DeriveJsonEncoder {
param.typeclass.toJsonAST(param.dereference(a)).map { value =>
if (
(!writeNulls && value == Json.Null) ||
(!writeEmptyCollections && (value.asArray.exists(_.isEmpty) || (value.asObject.exists(_.fields.isEmpty))))
(!writeEmptyCollections && (value.asArray
.exists(_.isEmpty) || (value.asObject.exists(_.fields.isEmpty))))
) chunk
else chunk :+ name -> value
}

0 comments on commit e913e99

Please sign in to comment.