Multiline description with json
See original GitHub issueI’m adding descriptions with \n
but they are not interpreted.
Example:
{
"basePath": "/v1",
"consumes": [
"application/json"
],
"host": "test.com",
"info": {
"description": "Test\nTest",
"title": "Test",
"version": "1"
}
}
Am I doing something wrong or is this really an issue?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Are multi-line strings allowed in JSON? - Stack Overflow
JSON does not allow "real" newlines in its data ; it can only have escaped newlines. See the answer from @YOU. According to...
Read more >Storing multi-line strings in JSON with JSONLint - Gun.io
This quick hack helps find a way to store multi-line strings in JSON to interact with JS and Node.
Read more >JSON Multi-Line String - Linux Hint
A creative way of inserting a multi-line string in JSON is to use an array. We can separate each line as an individual...
Read more >Need a human friendly multi-line "description" in json-schemas
The current "description" property is a string only, can it be made into either a string or a string array so that it...
Read more >Solved: multi line string in json is being rejected.
multi line string in json is being rejected · 1. Add a compose above the HTTP action step. · 2. Construct the query...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think I found this bug in another element, can I request to reopen this issue? the fix is most likely very similar. I’m finding missing new lines on model descriptions/summery
“Horse”: { “terminalId”: { “type”: “string”, “description”: “Identification bla bla bla. \r\nIt must be possible to bla bla bla.\r\nThis information is only required for bla bla bla”, “nullable”: true } }
I have been able to get around this by simply adding <br /> to the xml summaries that are generating the model descriptions. Not a terrible way to do it, but a shame since newlines are supported in the output pipeline
Thanks a lot
@RomanGotsiy works for me! Thank you!