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<SupportingFile> supportingFiles = new ArrayList<SupportingFile>();
 | 
				
			||||||
    protected List<CliOption> cliOptions = new ArrayList<CliOption>();
 | 
					    protected List<CliOption> cliOptions = new ArrayList<CliOption>();
 | 
				
			||||||
    protected boolean skipOverwrite;
 | 
					    protected boolean skipOverwrite;
 | 
				
			||||||
 | 
					    protected boolean copyPropertiesFromParents = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public List<CliOption> cliOptions() {
 | 
					    public List<CliOption> cliOptions() {
 | 
				
			||||||
        return cliOptions;
 | 
					        return cliOptions;
 | 
				
			||||||
@ -533,7 +534,7 @@ public class DefaultCodegen {
 | 
				
			|||||||
                final String parentRef = toModelName(parent.getSimpleRef());
 | 
					                final String parentRef = toModelName(parent.getSimpleRef());
 | 
				
			||||||
                m.parent = parentRef;
 | 
					                m.parent = parentRef;
 | 
				
			||||||
                addImport(m, parentRef);
 | 
					                addImport(m, parentRef);
 | 
				
			||||||
                if (allDefinitions != null) {
 | 
					                if (copyPropertiesFromParents && allDefinitions != null) {
 | 
				
			||||||
                    final Model parentModel = allDefinitions.get(parentRef);
 | 
					                    final Model parentModel = allDefinitions.get(parentRef);
 | 
				
			||||||
                    if (parentModel instanceof ModelImpl) {
 | 
					                    if (parentModel instanceof ModelImpl) {
 | 
				
			||||||
                        final ModelImpl _parent = (ModelImpl) parentModel;
 | 
					                        final ModelImpl _parent = (ModelImpl) parentModel;
 | 
				
			||||||
 | 
				
			|||||||
@ -30,6 +30,7 @@ public class TypeScriptNodeClientCodegen extends DefaultCodegen implements Codeg
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	public TypeScriptNodeClientCodegen() {
 | 
						public TypeScriptNodeClientCodegen() {
 | 
				
			||||||
	    super();
 | 
						    super();
 | 
				
			||||||
 | 
							copyPropertiesFromParents = false;
 | 
				
			||||||
	    outputFolder = "generated-code/typescript-node";
 | 
						    outputFolder = "generated-code/typescript-node";
 | 
				
			||||||
	    modelTemplateFiles.put("model.mustache", ".ts");
 | 
						    modelTemplateFiles.put("model.mustache", ".ts");
 | 
				
			||||||
	    apiTemplateFiles.put("api.mustache", ".ts");
 | 
						    apiTemplateFiles.put("api.mustache", ".ts");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user