Я пишу файл JSON, который будет читать программа Java. Фрагмент следующий:Может ли значение JSON содержать многострочную строку
{
"testCases" :
{
"case.1" :
{
"scenario" : "this the case 1.",
"result" : "this is a very long line which is not easily readble.
so i would like to write it in multiple lines.
but, i do NOT require any new lines in the output.
I need to split the string value in this input file only.
such that I don't require to slide the horizontal scroll again and again while verifying the correctness of the statements.
the prev line, I have shown, without splitting just to give a feel of my problem"
}
}
}
{ "testCases" : { "case.1" : { "scenario" : "this the case 1.", "result" : "this is a very long line which is not easily readble. so i would like to write it in multiple lines. but, i do NOT require any new lines in the output. I need to split the string value in this input file only. such that I don't require to slide the horizontal scroll again and again while verifying the correctness of the statements. the prev line, I have shown, without splitting just to give a feel of my problem" } } } }
– user2409155возможно дубликат [строк Multiline в JSON] (HTTP: // StackOverflow .com/questions/2392766/multiline-strings-in-json) –
Я думаю, что это больше касается читаемости сериализованного файла JSON и _not_ о разрыве строк в загруженных данных (таким образом, это не дубликат [Многострочные строки в JSON] (http://stackoverflow.com/q/2392766/703040)). Подумайте об этом скорее как использование JSON в качестве файла конфигурации, где у вас длинная строка, и для удобства чтения полезно обернуть строку, если кто-то ее редактирует с помощью текстового редактора. – zashu