In my swagger document that I am editing using YAML. I was intending to insert a Block of code using GFM syntax which is what swagger expects according to this document.
description: >-
Some description of the object here.
More Here. An example to for this is as follows:
```json
{
"Key": {
"name": "myName",
"id": 100
}
}
```
This however does not show up formatted as a JSON, instead it all ends up being on one line like this:
Some description of the object here. More Here. An example to for this is as follows: ```json { "Key": { "name": "myName", "id": 100 } } ```
That it all ends up as one line is because you are using a folded style block scalar by specifying >
(-
is for stripping chomping indicator).
What you want to use is a literal style block scalar, with that the line breaks and spacing is preserved. You probably also want to use the default clip chomping (leaving one newline at the end of the JSON code):
description: |
Some description of the object here.
More Here. An example to for this is as follows:
```json
{
"Key": {
"name": "myName",
"id": 100
}
}
```
(the only change is on the first line >-
to |
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With