-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
When using the API, adding the UseDefaultExport option breaks the class inheritance on extracted TypeScript classes.
public interface IId
{
int Id { get; set; }
}
public interface IIdentifier
{
string Identifier { get; set; }
}
public class ProductDto : IId, IIdentifier
{
public int Id { get; set; }
public string Identifier { get; set; }
}
var gen = new Generator
{
Options =
{
BaseOutputDirectory = "./types",
UseDefaultExport = true // adding this option
}
};
internal class MyGenerationSpec : GenerationSpec
{
public MyGenerationSpec()
{
AddClass<ProductDto>();
}
}
gen.Generate(new List<GenerationSpec>(new[] { new MyGenerationSpec() }));Expected :
/**
* This is a TypeGen auto-generated file.
* Any changes made to this file can be lost when this file is regenerated.
*/
import IId from "./i-id";
import IIdentifier from "./i-identifier";
class ProductDto implements IId, IIdentifier {
id: number;
identifier: string;
}
export default ProductDto;Actual:
/**
* This is a TypeGen auto-generated file.
* Any changes made to this file can be lost when this file is regenerated.
*/
import IId from "./i-id";
import IIdentifier from "./i-identifier";
class ProductDto { // => missing implements IId, IIdentifier
id: number;
identifier: string;
}
export default ProductDto;Done with :
- net6.0 console app
- TypeGen 3.0.0
pdsrebelo and funky-jojo
Metadata
Metadata
Assignees
Labels
No labels