RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.39k stars 535 forks source link

C# TimeSpan not resolved and generated as a DayJs duration #1709

Open FreeFrags opened 3 months ago

FreeFrags commented 3 months ago

Im moving from MomentJS to DayJs in my code, i noticed that a C# TimeSpan was resolved as a moment,Duration. However now using DayJs it is resolving to a dayjs.Dayjs.

I think this is the line we are talking about: https://github.com/RicoSuter/NJsonSchema/blob/1569e52401628d009af8044d1886d5a26770d05c/src/NJsonSchema.CodeGeneration.TypeScript/TypeScriptTypeResolver.cs#L290

My question is, is this a bug and should this line be dayjs.Duration or... is this done on purpose?

FreeFrags commented 3 months ago

I created an issue in NSwag to, since if you decide this is an issue it might be nice to add the proper import too. https://github.com/RicoSuter/NSwag/issues/4925