Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date fields as string if typeStyle is Interface, but interface field as Date #4898

Open
gennadiipetrov opened this issue May 21, 2024 · 1 comment

Comments

@gennadiipetrov
Copy link

Hi. I use typeStyle as Interface in nswag file. And it generate DTOs fields as Date for dates. but in code it is string.
I found this #980 topic.

Are there some changes now (I mean 2024 year)? Can you give me some workaround for this? I want to use interfaces.

@PooSham
Copy link

PooSham commented Jun 24, 2024

but in code it is string

By that, do you mean that the runtime type is string? I also thought this used to work, but I'm doubting my memory... I'm trying to find in the generated api client if there are any changes that have affected this, but I can't find it. Maybe something changed in NJsonSchema?

I guess the solution is to implement jsonReviver on every class, by extending the classes and using the extended class as your services. But that's quite annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants