NSwag: Cannot use non-string Date Time type with Interface DTOs

If you configure NSwag like so: image

Then call a method that returns a date-time or date, the field that should contain a moment will just contain a string.

If you use DTO Type Style: Class, everything works fine as the init method on the generated class converts it.

Is this something we should handle? Or is this why you should be using Type Style: Class instead? (I expect the same bug happens with Date Time type: Date, but haven’t tested)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Will do soon 😃 Been a busy week. Would have been much busier without NSwag though!

On Fri, Jan 18, 2019 at 2:13 AM Rico Suter notifications@github.com wrote:

Interesing idea - can you create a new issue in NJsonSchema with all this text? 😃 and reference this issue here… otherwise we will lose track of it because the issue is closed…

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/RSuter/NSwag/issues/980#issuecomment-455495790, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfKVhMXTOf4HxauraegPVEz8VRbH15Pks5vEZ5cgaJpZM4PuOTA .