Why is JSON invalid if the commas are in a string?

Does anyone know why this JSON is invalid?

{"street_address":"Stone House Lane, Peckforton
, Tarporley
, London, Cheshire"}

I use Jackson for Java and complain about

java.lang.IllegalArgumentException: com.fasterxml.jackson.core.JsonParseException:     Unexpected end-of-input: was expecting closing quote for a string value
at [Source: java.io.StringReader@6ad16fc1; line: 1, column: 405]

I noticed that this JSON is also considered invalid on this online site: http://jsonviewer.stack.hu/

Answer: Thank you, for those curious, I deleted these unreadable characters using tr -cd '\ 11 \ 12 \ 15 \ 40- \ 176' <file> cleanFile

+4
source share
1 answer

/ JSON. / ( Windows 7) , ( -, ):

{"street_address":"Stone House Lane, Peckforton
 , Tarporley
 , London, Cheshire"}
                                               ^           ^
                                               here and here

, . / :

{"street_address":"Stone House Lane, Peckforton, Tarporley, London, Cheshire"}

char \u80A8.

+8

Source: https://habr.com/ru/post/1545144/


All Articles