Skip to content

Commit accd176

Browse files
paul-englishwing328
authored andcommitted
Ensure that ApiInvoker.scala can support UUID types (#4807)
1 parent a4e96b3 commit accd176

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart
1313

1414
import java.io.File
1515
import java.net.URLEncoder
16+
import java.util.UUID
1617
import javax.ws.rs.core.MediaType
1718

1819
import scala.collection.JavaConverters._
@@ -55,6 +56,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
5556
def escape(value: Long): String = value.toString
5657
def escape(value: Double): String = value.toString
5758
def escape(value: Float): String = value.toString
59+
def escape(value: UUID): String = value.toString
5860

5961
def deserialize(json: String, containerType: String, cls: Class[_]) = {
6062
if (cls == classOf[String]) {

samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.sun.jersey.multipart.file.FileDataBodyPart
2424

2525
import java.io.File
2626
import java.net.URLEncoder
27+
import java.util.UUID
2728
import javax.ws.rs.core.MediaType
2829

2930
import scala.collection.JavaConverters._
@@ -66,6 +67,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
6667
def escape(value: Long): String = value.toString
6768
def escape(value: Double): String = value.toString
6869
def escape(value: Float): String = value.toString
70+
def escape(value: UUID): String = value.toString
6971

7072
def deserialize(json: String, containerType: String, cls: Class[_]) = {
7173
if (cls == classOf[String]) {

0 commit comments

Comments
 (0)