Actually, after further investigation I'm no longer sure that is true. 
According to http://www.json.org/ the "\n" is valid in JSON.

Ben Newlin 

On 7/19/18, 8:58 AM, "Ben Newlin" <[email protected]> wrote:

    I believe newline characters used within JSON must be escaped. So if the 
JSON actually contains "\n" that is invalid. It must be "\\n".
    
    Ben Newlin 
    
    On 7/19/18, 3:19 AM, "Users on behalf of Răzvan Crainea" 
<[email protected] on behalf of [email protected]> wrote:
    
        Hi, Kirill!
        
        This doesn't seem to be an invalid JSON, but only a bad formatting of 
        the date. I agree it should not include the "\n", because it is 
useless, 
        but this doesn't make it invalid. Are you experiencing trouble with 
        using JSON libraries that don't support this format?
        
        Best regards,
        Răzvan
        
        On 07/17/2018 12:58 PM, Kirill Galinurov wrote:
        > Hi. I use opensips mi_json module to get statistics.
        > But for some commands it returns incorrect JSON.
        > For example /json/dr_reload_status returns
        > 
        > {"Partition": [{"value":"sipprovider_def", "attributes":{"Date": "Mon 
        > Jul 16 07:10:58 2018
        > "}}, {"value":"beeline", "attributes":{"Date": "Mon Jul 16 07:11:59 
2018
        > "}}, {"value":"megafon", "attributes":{"Date": "Mon Jul 16 07:11:59 
2018
        > "}}, {"value":"megafon", "attributes":{"Date": "Mon Jul 16 07:12:54 
2018
        > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul 16 07:12:54 2018
        > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul 16 07:13:51 2018
        > "}}, {"value":"beeline", "attributes":{"Date": "Mon Jul 16 07:13:52 
2018
        > "}}]}
        > 
        > This is incorrect, because it shoulde not include "\n" symbols.
        > 
        > 
        > _______________________________________________
        > Users mailing list
        > [email protected]
        > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
        > 
        
        -- 
        Răzvan Crainea
        OpenSIPS Core Developer
           http://www.opensips-solutions.com
        
        _______________________________________________
        Users mailing list
        [email protected]
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users
        
    
    

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to