Skip to content

Commit 87a730b

Browse files
committed
Merge branch 'develop_2.0' into develop_2.0_objc_contenttype
Conflicts: samples/client/petstore/objc/client/SWGPetApi.m
2 parents 3a8b149 + 2b7bbd9 commit 87a730b

File tree

313 files changed

+13961
-6390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+13961
-6390
lines changed

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ samples/server-generator/scalatra/output
2222
samples/server-generator/node/output/node_modules
2323
samples/server-generator/scalatra/target
2424
samples/server-generator/scalatra/output/.history
25-
25+
samples/client/petstore/qt5cpp/PetStore/moc_*
26+
samples/client/petstore/qt5cpp/PetStore/*.o
27+
samples/client/petstore/objc/PetstoreClient.xcworkspace/xcuserdata
28+
samples/client/petstore/qt5cpp/build-*
29+
samples/client/petstore/qt5cpp/PetStore/PetStore
30+
samples/client/petstore/qt5cpp/PetStore/Makefile
31+
samples/client/petstore/java/hello.txt
32+
samples/client/petstore/android-java/hello.txt
33+
samples/client/petstore/objc/Build
34+
samples/client/petstore/objc/Pods
35+
samples/server/petstore/nodejs/node_modules
2636
target
2737
.idea
2838
.lib

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ JavaClientCodegen.java
150150
JaxRSServerCodegen.java
151151
NodeJSServerCodegen.java
152152
ObjcClientCodegen.java
153+
PerlClientCodegen.java
153154
PhpClientCodegen.java
155+
Python3ClientCodegen.java
154156
PythonClientCodegen.java
157+
Qt5CPPGenerator.java
155158
RubyClientCodegen.java
156159
ScalaClientCodegen.java
157160
ScalatraServerCodegen.java

bin/jaxrs-petstore-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ fi
2626

2727
# if you've executed sbt assembly previously it will use that instead.
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l jaxrs -o samples/server/petstore/jaxrs"
29+
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l jaxrs -o samples/server/petstore/jaxrs -Dswagger.codegen.jaxrs.impl.source=src/main/java"
3030

3131
java $JAVA_OPTS -jar $executable $ags

modules/swagger-codegen-cli/src/main/java/com/wordnik/swagger/codegen/cmd/Generate.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@ public class Generate implements Runnable {
5454
"Pass in a URL-encoded string of name:header with a comma separating multiple values")
5555
private String auth;
5656

57+
@Option( name= {"-D"}, title = "system properties", description = "sets specified system properties in " +
58+
"the format of name=value,name=value")
59+
private String systemProperties;
60+
5761
@Override
5862
public void run() {
5963
verbosed(verbose);
6064

65+
setSystemProperties();
66+
6167
ClientOptInput input = new ClientOptInput();
6268

6369
if (isNotEmpty(auth)) {
@@ -77,6 +83,17 @@ public void run() {
7783
new DefaultGenerator().opts(input.opts(new ClientOpts()).swagger(swagger)).generate();
7884
}
7985

86+
private void setSystemProperties() {
87+
if( systemProperties != null && systemProperties.length() > 0 ){
88+
for( String property : systemProperties.split(",")) {
89+
int ix = property.indexOf('=');
90+
if( ix > 0 && ix < property.length()-1 ){
91+
System.setProperty( property.substring(0, ix), property.substring(ix+1) );
92+
}
93+
}
94+
}
95+
}
96+
8097
/**
8198
* If true parameter, adds system properties which enables debug mode in generator
8299
* @param verbose - if true, enables debug mode

modules/swagger-codegen/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
<relativePath>../..</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
9-
<groupId>com.wordnik</groupId>
109
<artifactId>swagger-codegen</artifactId>
1110
<packaging>jar</packaging>
1211
<name>swagger-codegen (core library)</name>
13-
<version>2.1.1-M2-SNAPSHOT</version>
1412
<build>
1513
<sourceDirectory>src/main/java</sourceDirectory>
1614
<defaultGoal>install</defaultGoal>

modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ public interface CodegenConfig {
5656
Map<String, Object> postProcessModels(Map<String, Object> objs);
5757
Map<String, Object> postProcessOperations(Map<String, Object> objs);
5858
Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs);
59+
60+
String apiFilename(String templateName, String tag);
61+
62+
boolean shouldOverwrite(String filename);
5963
}

modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public class CodegenModel {
1111
public String defaultValue;
1212
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
1313
public Set<String> imports = new HashSet<String>();
14-
public Boolean hasVars, emptyVars, hasMoreModels;
14+
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums;
1515
public ExternalDocs externalDocs;
1616
}

modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class CodegenParameter {
44
public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
55
isCookieParam, isBodyParam, isFile, notFile, hasMore, isContainer, secondaryParam;
6-
public String baseName, paramName, dataType, collectionFormat, description, baseType;
6+
public String baseName, paramName, dataType, collectionFormat, description, baseType, defaultValue;
77
public String jsonSchema;
88

99
/**
@@ -34,7 +34,8 @@ public CodegenParameter copy() {
3434
output.isBodyParam = this.isBodyParam;
3535
output.required = this.required;
3636
output.jsonSchema = this.jsonSchema;
37+
output.defaultValue = this.defaultValue;
3738

3839
return output;
3940
}
40-
}
41+
}

modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenProperty.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ public class CodegenProperty {
1616
public String example;
1717

1818
public String jsonSchema;
19-
public Double minimum, maximum, exclusiveMinimum, exclusiveMaximum;
19+
public Double minimum;
20+
public Double maximum;
21+
public Boolean exclusiveMinimum;
22+
public Boolean exclusiveMaximum;
2023
public Boolean hasMore = null, required = null, secondaryParam = null;
2124
public Boolean isPrimitiveType, isContainer, isNotContainer;
2225
public boolean isEnum;
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
package com.wordnik.swagger.codegen;
22

3-
import java.util.*;
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
import java.util.Map;
46

57
public class CodegenResponse {
68
public String code, message;
79
public Boolean hasMore;
8-
public List<Map<String, String>> examples;
10+
public List<Map<String, Object>> examples;
911
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
1012
public String dataType, baseType, containerType;
13+
public Boolean isDefault;
1114
public Boolean simpleType;
1215
public Boolean primitiveType;
1316
public Boolean isMapContainer;
1417
public Boolean isListContainer;
1518
public Object schema;
1619
public String jsonSchema;
17-
}
20+
public boolean isWildcard() { return "0".equals(code) || "default".equals(code); }
21+
}

0 commit comments

Comments
 (0)