forked from loafle/openapi-generator-original
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:
commit
a6876b8028
@ -16,7 +16,10 @@ public class CodegenProperty {
|
|||||||
public String example;
|
public String example;
|
||||||
|
|
||||||
public String jsonSchema;
|
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 hasMore = null, required = null, secondaryParam = null;
|
||||||
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
||||||
public boolean isEnum;
|
public boolean isEnum;
|
||||||
|
@ -1024,13 +1024,13 @@ public class DefaultCodegen {
|
|||||||
return secs;
|
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)
|
if(examples == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
List<Map<String, String>> output = new ArrayList<Map<String, String>>();
|
List<Map<String, String>> output = new ArrayList<Map<String, String>>();
|
||||||
for(String key: examples.keySet()) {
|
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>();
|
Map<String, String> kv = new HashMap<String, String>();
|
||||||
kv.put("contentType", key);
|
kv.put("contentType", key);
|
||||||
|
@ -22,7 +22,7 @@ public class ExampleGenerator {
|
|||||||
this.examples = examples;
|
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>>();
|
List<Map<String, String>> output = new ArrayList<Map<String, String>>();
|
||||||
Set<String> processedModels = new HashSet<String>();
|
Set<String> processedModels = new HashSet<String>();
|
||||||
if(examples == null ) {
|
if(examples == null ) {
|
||||||
@ -54,7 +54,7 @@ public class ExampleGenerator {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(String key: examples.keySet()) {
|
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>();
|
Map<String, String> kv = new HashMap<String, String>();
|
||||||
kv.put("contentType", key);
|
kv.put("contentType", key);
|
||||||
|
15
pom.xml
15
pom.xml
@ -302,18 +302,6 @@
|
|||||||
<module>samples/client/petstore/java</module>
|
<module>samples/client/petstore/java</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</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>
|
<profile>
|
||||||
<id>objc-client</id>
|
<id>objc-client</id>
|
||||||
<activation>
|
<activation>
|
||||||
@ -373,7 +361,6 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>samples/client/petstore/android-java</module>
|
<module>samples/client/petstore/android-java</module>
|
||||||
<module>samples/client/petstore/java</module>
|
<module>samples/client/petstore/java</module>
|
||||||
<module>samples/client/petstore/scala</module>
|
|
||||||
<module>samples/server/petstore/jaxrs</module>
|
<module>samples/server/petstore/jaxrs</module>
|
||||||
<module>samples/server/petstore/spring-mvc</module>
|
<module>samples/server/petstore/spring-mvc</module>
|
||||||
<module>samples/client/petstore/objc</module>
|
<module>samples/client/petstore/objc</module>
|
||||||
@ -453,7 +440,7 @@
|
|||||||
<swagger-parser-version>1.0.6-SNAPSHOT</swagger-parser-version>
|
<swagger-parser-version>1.0.6-SNAPSHOT</swagger-parser-version>
|
||||||
<scala-version>2.10.4</scala-version>
|
<scala-version>2.10.4</scala-version>
|
||||||
<felix-version>2.3.4</felix-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>
|
<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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user