forked from loafle/openapi-generator-original
* [AVRO] Fix the package handling for the avro generator (#3987) Also fix an issue with the outputFolder that wasn't overridable through opts * Update sample files through avro-petstore.sh There's an issue with inlined object but it's already present with the previous commit * Revert the fix on outputFolder (not a bug)
This commit is contained in:
parent
4e47426224
commit
87c77076ef
@ -43,8 +43,8 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
outputFolder = "generated-code/avro-schema";
|
outputFolder = "generated-code/avro-schema";
|
||||||
modelTemplateFiles.put("model.mustache", ".avsc");
|
modelTemplateFiles.put("model.mustache", ".avsc");
|
||||||
apiPackage = "api";
|
// Force the model package to the package name so import can be fully qualified
|
||||||
modelPackage = "model";
|
modelPackage = packageName;
|
||||||
importMapping.clear();
|
importMapping.clear();
|
||||||
embeddedTemplateDir = templateDir = AVRO;
|
embeddedTemplateDir = templateDir = AVRO;
|
||||||
|
|
||||||
@ -81,10 +81,12 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
super.processOpts();
|
super.processOpts();
|
||||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||||
packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME);
|
packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME);
|
||||||
|
|
||||||
|
// Force the model package to the package name so import can be fully qualified
|
||||||
|
modelPackage = packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
additionalProperties.put("packageName", packageName);
|
additionalProperties.put("packageName", packageName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -132,4 +134,4 @@ public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1 +1 @@
|
|||||||
4.1.1-SNAPSHOT
|
4.2.0-SNAPSHOT
|
@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "file",
|
"name": "file",
|
||||||
"type": ["null", "model.File"],
|
"type": ["null", ],
|
||||||
"doc": "file to upload"
|
"doc": "file to upload"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user