common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data

Home Page:https://www.commonwl.org/v1.2/SchemaSalad.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TypeScript Codegen] Assign default value for 'class' parameter in document constructors

ZimmerA opened this issue · comments

In code generated by the TypeScript codegen(#479), if a document has a class field, the documents' constructor should contain a default value with its class name for this field.

Example before:

export class CommandLineTool extends Saveable implements Internal.Process {
...
  constructor ({extensionFields, loadingOptions, ... , class_, ...} : 
               {extensionFields?: Dictionary<any>, loadingOptions?: LoadingOptions, ..., class_: string, ...}) {
      super()
...
      this.class_ = class_
...
   }
}

Example after:

export class CommandLineTool extends Saveable implements Internal.Process {
...
  constructor ({extensionFields, loadingOptions, ... , class_ = "CommandLineTool", ...} : 
               {extensionFields?: Dictionary<any>, loadingOptions?: LoadingOptions, ..., class_: string, ...}) {
      super()
...
      this.class_ = class_
...
   }
}

Implemented with 4d74e18