Merge branches 'core-1.5.2-M2-compatibility' and 'jaxrs-interface-generation' of https://github.com/swagger-api/swagger-codegen into jaxrs-interface-generation

This commit is contained in:
Ole Lensmar 2015-05-20 18:14:54 -06:00
commit a6876b8028
4 changed files with 9 additions and 19 deletions

View File

@ -16,7 +16,10 @@ public class CodegenProperty {
public String example;
public String jsonSchema;
public Double minimum, maximum, exclusiveMinimum, exclusiveMaximum;
public Double minimum;
public Double maximum;
public Boolean exclusiveMinimum;
public Boolean exclusiveMaximum;
public Boolean hasMore = null, required = null, secondaryParam = null;
public Boolean isPrimitiveType, isContainer, isNotContainer;
public boolean isEnum;

View File

@ -1024,13 +1024,13 @@ public class DefaultCodegen {
return secs;
}
protected List<Map<String, String>> toExamples(Map<String, String> examples) {
protected List<Map<String, String>> toExamples(Map<String, Object> examples) {
if(examples == null)
return null;
List<Map<String, String>> output = new ArrayList<Map<String, String>>();
for(String key: examples.keySet()) {
String value = examples.get(key);
String value = String.valueOf(examples.get(key));
Map<String, String> kv = new HashMap<String, String>();
kv.put("contentType", key);

View File

@ -22,7 +22,7 @@ public class ExampleGenerator {
this.examples = examples;
}
public List<Map<String, String>> generate(Map<String, String> examples, List<String> mediaTypes, Property property) {
public List<Map<String, String>> generate(Map<String, Object> examples, List<String> mediaTypes, Property property) {
List<Map<String, String>> output = new ArrayList<Map<String, String>>();
Set<String> processedModels = new HashSet<String>();
if(examples == null ) {
@ -54,7 +54,7 @@ public class ExampleGenerator {
}
else {
for(String key: examples.keySet()) {
String value = examples.get(key);
String value = String.valueOf(examples.get(key));
Map<String, String> kv = new HashMap<String, String>();
kv.put("contentType", key);

15
pom.xml
View File

@ -302,18 +302,6 @@
<module>samples/client/petstore/java</module>
</modules>
</profile>
<profile>
<id>scala-client</id>
<activation>
<property>
<name>env</name>
<value>scala</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/scala</module>
</modules>
</profile>
<profile>
<id>objc-client</id>
<activation>
@ -373,7 +361,6 @@
<modules>
<module>samples/client/petstore/android-java</module>
<module>samples/client/petstore/java</module>
<module>samples/client/petstore/scala</module>
<module>samples/server/petstore/jaxrs</module>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/client/petstore/objc</module>
@ -453,7 +440,7 @@
<swagger-parser-version>1.0.6-SNAPSHOT</swagger-parser-version>
<scala-version>2.10.4</scala-version>
<felix-version>2.3.4</felix-version>
<swagger-core-version>1.5.1-M2</swagger-core-version>
<swagger-core-version>1.5.2-M2</swagger-core-version>
<scala-test-version>2.1.4</scala-test-version>
<commons-io-version>2.3</commons-io-version>
<commons-cli-version>1.2</commons-cli-version>