Skip to content

Commit 8120c85

Browse files
committed
Regen Samples
1 parent 596a750 commit 8120c85

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

samples/client/petstore/scala-sttp-circe/src/main/scala/org/openapitools/client/core/AdditionalTypeSerializers.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ trait AdditionalTypeSerializers {
2525
implicit final lazy val FileDecoder: Decoder[File] = Decoder[Array[Byte]].emap { bytes =>
2626
try {
2727
val tmpFile = File.createTempFile("download", ".tmp")
28-
tmpFile.deleteOnExit()
2928
Files.write(tmpFile.toPath, bytes)
3029
Right(tmpFile)
3130
} catch {
@@ -41,6 +40,12 @@ trait AdditionalTypeSerializers {
4140

4241
implicit final lazy val AnyEncoder: Encoder[Any] = Encoder.instance {
4342
case json: Json => json
43+
case b: Boolean => Json.fromBoolean(b)
44+
case n: Int => Json.fromInt(n)
45+
case n: Long => Json.fromLong(n)
46+
case n: Double => Json.fromDoubleOrNull(n)
47+
case n: BigDecimal => Json.fromBigDecimal(n)
48+
case s: String => Json.fromString(s)
4449
case other => Json.fromString(other.toString)
4550
}
4651
}

0 commit comments

Comments
 (0)