forked from loafle/openapi-generator-original
Conditional copy properties from parent.
Pull request #946 broke the TypeScript generation with inheritance where a superclass defined an enum. This makes it up to each language to decide the behavior appropriate for the language.
This commit is contained in:
parent
cde8d7ba4c
commit
e924cec595
@ -80,6 +80,7 @@ public class DefaultCodegen {
|
||||
protected List<SupportingFile> supportingFiles = new ArrayList<SupportingFile>();
|
||||
protected List<CliOption> cliOptions = new ArrayList<CliOption>();
|
||||
protected boolean skipOverwrite;
|
||||
protected boolean copyPropertiesFromParents = true;
|
||||
|
||||
public List<CliOption> cliOptions() {
|
||||
return cliOptions;
|
||||
@ -533,7 +534,7 @@ public class DefaultCodegen {
|
||||
final String parentRef = toModelName(parent.getSimpleRef());
|
||||
m.parent = parentRef;
|
||||
addImport(m, parentRef);
|
||||
if (allDefinitions != null) {
|
||||
if (copyPropertiesFromParents && allDefinitions != null) {
|
||||
final Model parentModel = allDefinitions.get(parentRef);
|
||||
if (parentModel instanceof ModelImpl) {
|
||||
final ModelImpl _parent = (ModelImpl) parentModel;
|
||||
|
@ -30,6 +30,7 @@ public class TypeScriptNodeClientCodegen extends DefaultCodegen implements Codeg
|
||||
|
||||
public TypeScriptNodeClientCodegen() {
|
||||
super();
|
||||
copyPropertiesFromParents = false;
|
||||
outputFolder = "generated-code/typescript-node";
|
||||
modelTemplateFiles.put("model.mustache", ".ts");
|
||||
apiTemplateFiles.put("api.mustache", ".ts");
|
||||
|
Loading…
x
Reference in New Issue
Block a user