-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
TimeSpan Mismatch between Schema(string) vs Serialization(object graph) #2668
Comments
Somehow timespan is not converted to a string, eg “00:05:00”. So you probably just need a global json converter which does that as expected, no? |
Are you saying in my instance its broken? (just trying to determine if what I am seeing is expected behavior or not)
where would I go about doing this on the server? |
OK - I know why I am confused - I am using NetCoreApp3.1 (upgraded)... and it seems that the json serialization is no longer based on Newtonsoft... There is no converter for TimeSpan! |
Ah, yeah on 3.1 with System.Json.Text there are mismatches expected because the default newtonsoft serializer (nswag) might not match the new serializer behavior. |
See: #2243 |
@RicoSuter - makes sense - closing this - thanks |
Can't seem to deserialize a class with TimeSpan from the
swagger2csclient
generated clients.The error i get on the client is
Not sure if this is related, but I noticed the data returned during serialization doesn't seem to match the schema (see image below)
I thought TimeSpan was supported.. but I guess I have to add it?
how would one go about adding TimeSpan support to the RestAPI and Nswag the CSharp generated clients?
On the server / Rest side: Do i have to use this:
https://github.com/RicoSuter/NJsonSchema/wiki/Type-Mappers
Or do I use Netwonsoft settings?
On the client,
I see there are options to expose the JsonSerializerSettings but the CreateSerializerSettings is not virtual.
The text was updated successfully, but these errors were encountered: