common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data
https://www.commonwl.org/v1.2/SchemaSalad.html
Apache License 2.0
72 stars 62 forks source link

[Codegen] Remove redundancies in interfaces generated by the Java and TypeScript codegens #489

Open ZimmerA opened 2 years ago

ZimmerA commented 2 years ago

Currently, the Interfaces generated by the Java and TypeScript codegens contain redundancies in their fields caused by fields being passed down the inheritance hierarchy of the classes by the codegen.

Two possible solutions: a) Mark inherited fields with a flag like is_inherited b) Make sure that subclasses get generated after parent classes (might already be the case?). This means you can store which fields are from which class and subclasses can check if a class it is inheriting from already has the field that is currently being declared

ZimmerA commented 2 years ago

See https://github.com/common-workflow-language/schema_salad/issues/487#issuecomment-996607586 for a walkthrough of the problem