Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{#isQueryParam}}
{{#collectionFormat}}val {{paramName}}String = params.getAs[String]("{{paramName}}")
val {{paramName}} = if("{{collectionFormat}}".equals("default")) {
val {{paramName}} = if("{{collectionFormat}}" == "default" || "{{collectionFormat}}" == "csv") {
{{paramName}}String match {
case Some(str) => str.split(",")
case None => List()
case Some(str) => str.split(",").toSeq
case None => Seq()
}
}
else
List()
Seq()
{{/collectionFormat}}
{{^collectionFormat}}val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}"){{/collectionFormat}}
{{/isQueryParam}}
{{/isQueryParam}}
180 changes: 90 additions & 90 deletions samples/client/petstore-security-test/scala/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<joda-version>1.2</joda-version>
<joda-time-version>2.2</joda-time-version>
<jersey-version>1.19</jersey-version>
<swagger-core-version>1.5.8</swagger-core-version>
<swagger-core-version>1.5.9</swagger-core-version>
<jersey-async-version>1.0.5</jersey-async-version>
<maven-plugin.version>1.0.0</maven-plugin.version>
<jackson-version>2.4.2</jackson-version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
/**
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.swagger.client
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
/**
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.swagger.client.api
Expand All @@ -37,45 +25,40 @@ import java.util.Date

import scala.collection.mutable.HashMap

class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end \\r\\n \\n \\r/v2 *_/ &#39; \&quot; &#x3D;end \\r\\n \\n \\r",
class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r/v2 *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r",
defApiInvoker: ApiInvoker = ApiInvoker) {
var basePath = defBasePath
var apiInvoker = defApiInvoker

def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value

/**
* To test code injection *_/ &#39; \&quot; &#x3D;end \\r\\n \\n \\r
* To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*
* @param testCodeInjectEndRnNR To test code injection *_/ &#39; \&quot; &#x3D;end \\r\\n \\n \\r (optional)
* @param testCodeInjectEndRnNR To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r (optional)
* @return void
*/
def testCodeInject * &#39; &quot; &#x3D;end rn n r (testCodeInjectEndRnNR: String) = {
def testCodeInject * &#39; &quot; &#x3D;end rn n r(testCodeInjectEndRnNR: Option[String] = None) = {
// create path and map variables
val path = "/fake".replaceAll("\\{format\\}","json")
val contentTypes = List("application/json", "*/ ' =end

", "application/json")
val path = "/fake".replaceAll("\\{format\\}", "json")

val contentTypes = List("application/json", "*_/ ' =end -- ")
val contentType = contentTypes(0)

// query params
val queryParams = new HashMap[String, String]
val headerParams = new HashMap[String, String]
val formParams = new HashMap[String, String]




var postBody: AnyRef = null

if(contentType.startsWith("multipart/form-data")) {
val mp = new FormDataMultiPart()

mp.field("test code inject */ &#39; &quot; &#x3D;end \r\n \n \r", testCodeInjectEndRnNR.toString(), MediaType.MULTIPART_FORM_DATA_TYPE)

if (contentType.startsWith("multipart/form-data")) {
val mp = new FormDataMultiPart
testCodeInjectEndRnNR.map(paramVal => mp.field("test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE))
postBody = mp
}
else {
formParams += "test code inject */ &#39; &quot; &#x3D;end \r\n \n \r" -> testCodeInjectEndRnNR.toString()
} else {
testCodeInjectEndRnNR.map(paramVal => formParams += "test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r" -> paramVal.toString)
}

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
/**
* Swagger Petstore *_/ ' \" =end \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end \\r\\n \\n \\r
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.swagger.client.model




case class ModelReturn (
/* property description *_/ ' \" =end \\r\\n \\n \\r */
_return: Integer)
/* property description *_/ ' \" =end -- \\r\\n \\n \\r */
_return: Integer
)
Loading