PerfectlyNormal / TypeContractor

A dotnet tool for converting C# classes/enums to TypeScript interfaces/enums
MIT License
0 stars 0 forks source link

Nested dictionary with inheritance gets translated wrong #15

Open PerfectlyNormal opened 11 months ago

PerfectlyNormal commented 11 months ago

Input type: class SchedulesResponse : Dictionary<Guid, Dictionary<DateTimeOffset, IEnumerable<WorkingPeriodResponse>>>

Output: Attempted to import IEqualityComparer``1 (System.Collections.Generic.IEqualityComparer``1[[System.Guid, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) in SchedulesResponse

Expected: { [key: string]: { [key: string]: WorkingPeriodResponse[] } }

PerfectlyNormal commented 11 months ago

Creates a lot of garbage

image

PerfectlyNormal commented 9 months ago

Serializing a similar structure gives

{
  "207ae1a7-934c-410c-acb5-2c81b154b8c9": {
    "2024-01-01T00:00:00": {
      "StringProperty": null,
      "NumberProperty": null,
      "NumbersProperty": null,
      "DoubleTime": 0,
      "TimeyWimeySpan": "00:00:00",
      "SomeObject": null
    }
  }
}