`x ts` generates invalid dto.ts definitions
jsobell opened this issue · 1 comments
jsobell commented
If you have a DTO in your API called 'Stream' it is renamed to 'string' in the generated dtos.ts file, which is invalid typescript:
[Serializable]
[DataContract]
public partial class Stream
{
/// <summary>Gets or sets the Description field. Derived from Entity Model Field 'Stream.Description'</summary>
[DataMember]
public System.String Description { get; set; }
/// <summary>Gets or sets the Name field. Derived from Entity Model Field 'Stream.Name'</summary>
[DataMember]
public System.String Name { get; set; }
/// <summary>Gets or sets the ProjectId field. Derived from Entity Model Field 'Stream.ProjectId'</summary>
[DataMember]
public System.Guid ProjectId { get; set; }
/// <summary>Gets or sets the Streamid field. Derived from Entity Model Field 'Stream.Streamid'</summary>
[DataMember]
public System.Int32 Streamid { get; set; }
}generates
// @DataContract
export class string
{
// @DataMember
public Description: string;
// @DataMember
public Name: string;
// @DataMember
public ProjectId: string;
// @DataMember
public Streamid: number;
public constructor(init?: Partial<string>) { (Object as any).assign(this, init); }
}Obviously, 'Stream' is a bad name for a class, but when generated by an ORM it's not practical or desirable to change it :/
mythz commented
In which case you'll need to remove it from:
TypeScriptGenerator.TypeAliases.Remove(nameof(Stream));