forked from loafle/openapi-generator-original
[feign] Use feign-form (#4124)
* [feign] Use feign-form Fix #4108 * [feign] Convert java.util.Date params to rfc3339 with an Expander
This commit is contained in:
committed by
wing328
parent
51b941cf88
commit
901a981f26
@@ -273,8 +273,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
importMapping.put("LocalDate", "org.joda.time.LocalDate");
|
||||
importMapping.put("DateTime", "org.joda.time.DateTime");
|
||||
}
|
||||
else if (dateLibrary.startsWith("java8")) {
|
||||
} else if (dateLibrary.startsWith("java8")) {
|
||||
additionalProperties.put("java8", "true");
|
||||
typeMapping.put("date", "LocalDate");
|
||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||
@@ -285,6 +284,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
typeMapping.put("DateTime", "OffsetDateTime");
|
||||
importMapping.put("OffsetDateTime", "java.time.OffsetDateTime");
|
||||
}
|
||||
} else if (dateLibrary.equals("legacy")) {
|
||||
additionalProperties.put("legacyDates", "true");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,8 +136,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida
|
||||
}
|
||||
|
||||
if ("feign".equals(getLibrary())) {
|
||||
supportingFiles.add(new SupportingFile("FormAwareEncoder.mustache", invokerFolder, "FormAwareEncoder.java"));
|
||||
additionalProperties.put("jackson", "true");
|
||||
supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java"));
|
||||
} else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) {
|
||||
// the "okhttp-gson" library template requires "ApiCallback.mustache" for async call
|
||||
supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java"));
|
||||
|
||||
Reference in New Issue
Block a user