Skip to content

IgnoreBase()/TsIgnoreBaseAttribute doesn't work with interfaces #129

@patryqs

Description

@patryqs

When we want to generate the "Test" class that inherits from "ITest", although we use "IgnoreBase ()", a Test file is generated that inherits from the "ITest" interface but does not generate the "ITest" file.
The same thing happens when I use "TsIgnoreBaseAttribute" instead of "IgnoreBase()".
In case it inherits from another class (not an interface), everything works fine.

  • net6.0
  • TypeGen 3.0.0
    public class Test : ITest
    {
         public string Name { get; set; }
    }

    public interface ITest
    {
        public string Name { get; set; }
    }


    public class TestGenerationSpec : GenerationSpec
    {
        public override void OnBeforeGeneration(OnBeforeGenerationArgs args)
        {
            AddClass<Test>("models")
                .IgnoreBase();
        }
    }

Expected :

/**
 * This is a TypeGen auto-generated file.
 * Any changes made to this file can be lost when this file is regenerated.
 */

export class Test {
    public name : string = '';
}

Actual:

/**
 * This is a TypeGen auto-generated file.
 * Any changes made to this file can be lost when this file is regenerated.
 */

export class Test implements ITest {
    public name: string = '';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions