Open motuzko opened 4 years ago
This is a bug in NJsonSchema and needs to be reproduced there in a unit test and fixed.
This is a bug in NJsonSchema and needs to be reproduced there in a unit test and fixed.
Will this fix? public Dictionary<SubscriptionProcessType, SubscriptionSettingsItem> SubscriptionSettings { get; set; }
generate ts file with wrong interface subscriptionSettings?: { [key in keyof typeof ISubscriptionProcessType]?: ISubscriptionSettingsItem; } | null;
But the class is generated normally subscriptionSettings?: { [key in keyof typeof SubscriptionProcessType]?: SubscriptionSettingsItem; } | null;
Test project attached.
NSwagIssue.zip
The missing Tools folder should contain the generator
The problem:
If the dictionary is Dictionary<TestEnum, Some_struct_ie_Decimal> the generated typescript is OK If the dictionary is Dictionary<TestEnum, Some_class> the generated typescript is OK in the class, but wrong in the interface (it adds I to the TestEnum):
export interface ITestClassWithDict2 { dictionary?: { [key in keyof typeof ITestEnum]?: ITestClass1; } | null; }
The typescript file is generated by the Client.Typescript project.
The nswag.json is there.
Please adivse.