Skip to content

Commit

Permalink
fix scala-akka java8 serializers (OpenAPITools#5742)
Browse files Browse the repository at this point in the history
* fix scala-akka java8 serializers

* regenerate samples for akka-http
  • Loading branch information
chameleon82 authored and michaelpro1 committed May 7, 2020
1 parent db475dd commit 5df7e5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ object Serializers {
case object LocalDateSerializer extends CustomSerializer[LocalDate]( _ => ( {
case JString(s) => LocalDate.parse(s)
}, {
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
case d: LocalDate =>
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
}))
{{/java8}}
{{#joda}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ object Serializers {
case object LocalDateSerializer extends CustomSerializer[LocalDate]( _ => ( {
case JString(s) => LocalDate.parse(s)
}, {
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
case d: LocalDate =>
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
}))

def all: Seq[Serializer[_]] = Seq[Serializer[_]]() :+ DateTimeSerializer :+ LocalDateSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ object Serializers {
case object LocalDateSerializer extends CustomSerializer[LocalDate]( _ => ( {
case JString(s) => LocalDate.parse(s)
}, {
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
case d: LocalDate =>
JString(d.format(DateTimeFormatter.ISO_LOCAL_DATE))
}))

def all: Seq[Serializer[_]] = Seq[Serializer[_]]() :+ DateTimeSerializer :+ LocalDateSerializer
Expand Down

0 comments on commit 5df7e5b

Please sign in to comment.