do not map UUID as model in java (#5026)

This commit is contained in:
wing328 2017-03-11 20:32:46 +08:00 committed by GitHub
parent 2b9b0f31dc
commit 0ce6c7e3a8
3 changed files with 8 additions and 5 deletions

View File

@ -811,6 +811,7 @@ public class DefaultCodegen {
typeMapping.put("ByteArray", "byte[]");
typeMapping.put("binary", "byte[]");
typeMapping.put("file", "File");
typeMapping.put("UUID", "UUID");
instantiationTypes = new HashMap<String, String>();

View File

@ -317,6 +317,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
typeMapping.put("array", "java.util.List");
typeMapping.put("map", "java.util.Map");
typeMapping.put("DateTime", "java.util.Date");
typeMapping.put("UUID", "java.util.UUID");
typeMapping.remove("List");
importMapping.remove("Date");
importMapping.remove("Map");
@ -326,6 +327,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
importMapping.remove("List");
importMapping.remove("Set");
importMapping.remove("DateTime");
importMapping.remove("UUID");
instantiationTypes.put("array", "java.util.ArrayList");
instantiationTypes.put("map", "java.util.HashMap");
}

View File

@ -19,7 +19,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
{
static final String MEDIA_TYPE = "mediaType";
@SuppressWarnings("hiding")
@SuppressWarnings("hiding")
private static final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class);
public static final String USE_RX_JAVA = "useRxJava";
@ -102,9 +102,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen
if (additionalProperties.containsKey(USE_RX_JAVA2)) {
this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString()));
}
if (!useRxJava && !useRxJava2) {
additionalProperties.put(DO_NOT_USE_RX, true);
}
if (!useRxJava && !useRxJava2) {
additionalProperties.put(DO_NOT_USE_RX, true);
}
if (additionalProperties.containsKey(USE_PLAY24_WS)) {
this.setUsePlay24WS(Boolean.valueOf(additionalProperties.get(USE_PLAY24_WS).toString()));
}
@ -250,7 +250,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
if ( isMultipartType(operation.consumes) ) {
operation.isMultipart = Boolean.TRUE;
}
}
else {
operation.prioritizedContentTypes = prioritizeContentTypes(operation.consumes);
}