forked from loafle/openapi-generator-original
Fix a problem in the generation of typescript-jquery when we have enum in a query param (#7506)
This commit is contained in:
committed by
William Cheng
parent
1d661f3683
commit
d1933b5fca
@@ -72,6 +72,12 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg
|
||||
@Override
|
||||
public String getSwaggerType(Property p) {
|
||||
String swaggerType = super.getSwaggerType(p);
|
||||
if (p instanceof StringProperty) {
|
||||
StringProperty sp = (StringProperty) p;
|
||||
if (sp.getEnum() != null) {
|
||||
return swaggerType;
|
||||
}
|
||||
}
|
||||
if (isLanguagePrimitive(swaggerType) || isLanguageGenericType(swaggerType)) {
|
||||
return swaggerType;
|
||||
}
|
||||
@@ -108,7 +114,10 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg
|
||||
@Override
|
||||
public void postProcessParameter(CodegenParameter parameter) {
|
||||
super.postProcessParameter(parameter);
|
||||
parameter.dataType = addModelPrefix(parameter.dataType);
|
||||
|
||||
if (!parameter.isEnum) {
|
||||
parameter.dataType = addModelPrefix(parameter.dataType);
|
||||
}
|
||||
}
|
||||
|
||||
private void addNpmPackageGeneration() {
|
||||
|
||||
Reference in New Issue
Block a user