mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +00:00
Fix a problem in the generation of typescript-jquery when we have enum in a query param (#7506)
This commit is contained in:
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() {
|
||||
|
@ -1 +1 @@
|
||||
2.3.1
|
||||
2.4.0-SNAPSHOT
|
@ -1 +1 @@
|
||||
2.3.1
|
||||
2.4.0-SNAPSHOT
|
@ -1,4 +1,4 @@
|
||||
## @swagger/angular2-typescript-petstore@0.0.1
|
||||
## @swagger/jquery-typescript-petstore@0.0.1
|
||||
|
||||
This generator creates TypeScript/JavaScript client that utilizes [jQuery](https://jquery.com/). The generated Node module can be used in the following environments:
|
||||
|
||||
@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1 --save
|
||||
npm install @swagger/jquery-typescript-petstore@0.0.1 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@swagger/angular2-typescript-petstore",
|
||||
"name": "@swagger/jquery-typescript-petstore",
|
||||
"version": "0.0.1",
|
||||
"description": "JQuery client for @swagger/angular2-typescript-petstore",
|
||||
"description": "JQuery client for @swagger/jquery-typescript-petstore",
|
||||
"main": "api.js",
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
|
Loading…
Reference in New Issue
Block a user