How to insert JSON code for Swagger-API using YAML?

In my document that I am editing using YAML. I was about to insert a block of code using the GFM syntax that expects from it 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, is not displayed in JSON format, but it ends on one line:

Some description of the object here. More Here. An example to for this is as follows: ```json { "Key": { "name": "myName", "id": 100 } } ```
+4
source share
1 answer

It all ends up as one line, because you are using a folded-style scanning unit , specifying >( -is for the stripping indicator).

, , , . , ( JSON):

description: |
  Some description of the object here.
  More Here. An example to for this is as follows:
  ```json
  {
    "Key": {
      "name": "myName",
      "id": 100
    }
  }
  ```

( >- |)

+4

All Articles