You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if such option will be implemented.
Often external services provide json data not really caring whether numbers are quoted or not, and this results in more complicated code to support it.
Microsoft added it too in System.Text.Json some time ago (dotnet/runtime#30255)
The text was updated successfully, but these errors were encountered:
This only work when numbers are always quoted, and to support both quoted and not I'm ending up with two classes anyway (which I was trying to avoid - real structure is the same, only format differs).
In my case, quotes in numbers does not come entirely arbitrary, when I subscribe I know format.
My hope was that I could assign property a type, say long, and using some magic from the lib it will be cast to long whether it quoted or not.
I've implemented this as we also get bad formatted json, and we don't know whether numbers will be quoted or not. We're using it in production, but I'd rather get the bad json fixed when we can. The change is rather simple, it's just processing quotes inside ReadUtf8NumberInternal() and ReadUtf8NumberDigits() (and probably the Utf16 versions too, but we're not using those). This library is really good, so thank you!!!
I think processing bad json is not very good, but I have this change, and also allowing identifiers without quotes (for example, "{ Number: 5}", and bool values between quotes. If you are really thinking about implementing this, I might contribute (if my code makes any sense, of course).
It would be great if such option will be implemented.
Often external services provide json data not really caring whether numbers are quoted or not, and this results in more complicated code to support it.
Microsoft added it too in System.Text.Json some time ago (dotnet/runtime#30255)
The text was updated successfully, but these errors were encountered: