Skip to content

Commit

Permalink
[Scala] Properly handle csv collectionFormat (swagger-api#6540)
Browse files Browse the repository at this point in the history
* Add support for lists of path parameters (eg instances), and default params for optional case classes

* Update Petstore sample

* Revert defaulting of case class fields to None

* Update Petstore sample
  • Loading branch information
gmarz authored and fvarose committed Oct 12, 2017
1 parent 5225777 commit d135f50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
def escape(value: String): String = {
URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20")
}
def escape(values: List[String]): String = {
values.map(escape).mkString(",")
}

def escape(value: Long): String = value.toString
def escape(value: Double): String = value.toString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
def escape(value: String): String = {
URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20")
}
def escape(values: List[String]): String = {
values.map(escape).mkString(",")
}

def escape(value: Long): String = value.toString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
def escape(value: String): String = {
URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20")
}
def escape(values: List[String]): String = {
values.map(escape).mkString(",")
}

def escape(value: Long): String = value.toString
def escape(value: Double): String = value.toString
Expand Down

0 comments on commit d135f50

Please sign in to comment.