Closed Thorium closed 1 year ago
I think we can add JsonSaveOptions.CompactUriAware
case here?
I would also be ok with having just a single space after every comma if that would be easier.
Do you mean to change the behavior of the current DisableFormatting
case?
Although I can't imagine if there are any cases that rely upon the current behavior (no space after every comma),
but I think it would be more safe to add a case for your case.
If you use production setting (as you should) of
FSharp.Data.JsonSaveOptions.DisableFormatting
It will create a following JSON: {"url":"https://google.com","prop":"x"}...which looks correct to me, but as you can see, the major automatic parsers like GitHub, Google, Microsoft, etc fail to end the url link to the end-quote, and treat the URL as combining all the rest of the stuff going as part of that url. And as you can see, the full url is not working.
If a single space is added after the comma, then behold, the parsers are clever now: {"url":"https://google.com", "prop":"x"}
If you do FSharp.Data.JsonSaveOptions.None, then there is way too much unnecessary characters for a production system. Could we consider adding a little bit more serialization options?