Merge branch 'develop_2.0' into library-template-jersey2

This commit is contained in:
xhh 2015-08-08 11:18:17 +08:00
commit cb181e3480
7 changed files with 41 additions and 28 deletions

View File

@ -216,7 +216,7 @@ public class ApiInvoker {
} }
else if(String.class.equals(cls)) { else if(String.class.equals(cls)) {
if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1)
return json.substring(1, json.length() - 2); return json.substring(1, json.length() - 1);
else else
return json; return json;
} }

View File

@ -104,13 +104,26 @@
- (NSDictionary *) authSettings { - (NSDictionary *) authSettings {
return @{ return @{
@"api_key": @{ {{#authMethods}}
{{#isApiKey}}
@"{{name}}":
@{
@"type": @"api_key", @"type": @"api_key",
@"in": @"header", @"in": {{#isKeyInHeader}}@"header"{{/isKeyInHeader}}{{#isKeyInQuery}}@"query"{{/isKeyInQuery}},
@"key": @"api_key", @"key": @"{{keyParamName}}",
@"value": [self getApiKeyWithPrefix:@"api_key"] @"value": [self getApiKeyWithPrefix:@"{{keyParamName}}"]
}, },
{{/isApiKey}}
{{#isBasic}}
@"{{name}}":
@{
@"type": @"basic",
@"in": @"header",
@"key": @"Authorization",
@"value": [self getBasicAuthToken]
},
{{/isBasic}}
{{/authMethods}}
}; };
} }

View File

@ -59,7 +59,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
if (cls == classOf[String]) { if (cls == classOf[String]) {
json match { json match {
case s: String => { case s: String => {
if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 1)
else s else s
} }
case _ => null case _ => null

View File

@ -469,10 +469,10 @@
</repository> </repository>
</repositories> </repositories>
<properties> <properties>
<swagger-parser-version>1.0.9-SNAPSHOT</swagger-parser-version> <swagger-parser-version>1.0.10-SNAPSHOT</swagger-parser-version>
<scala-version>2.11.1</scala-version> <scala-version>2.11.1</scala-version>
<felix-version>2.3.4</felix-version> <felix-version>2.3.4</felix-version>
<swagger-core-version>1.5.0</swagger-core-version> <swagger-core-version>1.5.3-SNAPSHOT</swagger-core-version>
<scala-test-version>2.1.4</scala-test-version> <scala-test-version>2.1.4</scala-test-version>
<commons-io-version>2.3</commons-io-version> <commons-io-version>2.3</commons-io-version>
<commons-cli-version>1.2</commons-cli-version> <commons-cli-version>1.2</commons-cli-version>

View File

@ -216,7 +216,7 @@ public class ApiInvoker {
} }
else if(String.class.equals(cls)) { else if(String.class.equals(cls)) {
if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1)
return json.substring(1, json.length() - 2); return json.substring(1, json.length() - 1);
else else
return json; return json;
} }

View File

@ -104,13 +104,13 @@
- (NSDictionary *) authSettings { - (NSDictionary *) authSettings {
return @{ return @{
@"api_key": @{ @"api_key":
@{
@"type": @"api_key", @"type": @"api_key",
@"in": @"header", @"in": @"header",
@"key": @"api_key", @"key": @"api_key",
@"value": [self getApiKeyWithPrefix:@"api_key"] @"value": [self getApiKeyWithPrefix:@"api_key"]
}, },
}; };
} }

View File

@ -59,7 +59,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper,
if (cls == classOf[String]) { if (cls == classOf[String]) {
json match { json match {
case s: String => { case s: String => {
if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 1)
else s else s
} }
case _ => null case _ => null