HI,
I upgraded my project from 8.1 to 8.2. After the upgrade, the swagger generates different result for Timespan.
Before it generated Nullable Timespan like below for ListDto. this.startTime = data["startTime"]; this.endTime = data["endTime"];
now it generates it like below this.startTime = data["startTime"] ? TimeSpan.fromJS(data["startTime"]) : <any>undefined; this.endTime = data["endTime"] ? TimeSpan.fromJS(data["endTime"]) : <any>undefined; and this causes an error on below code
static fromJS(data: any): TimeSpan {
data = typeof data === 'object' ? data : {};
let result = new TimeSpan();
result.init(data);
return result;
}
Above method was not created in 8.1 and both Nullable not not Nullable timespan generates the same code.
Thanks.
2 Answer(s)
-
2
I fixed above issue by following below link.
https://github.com/domaindrivendev/Swashbuckle.AspNetCore#systemtextjson-stj-vs-newtonsoft
-
0
Thank you for saving me hours of work :)