---
title: Test api with callouts and mermaid plugin
slug: mihai-tests/test-api-with-callouts-and-mermaid-plugin
createdAt: 2024-05-23T13:14:55.472Z
---

{
  "id": "eENH-8G8V6j-5eU_AJJmq",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://petstore3.swagger.io/api/v3/pet",
    "servers": [
      {
        "url": "https://petstore3.swagger.io/api/v3/pet"
      }
    ],
    "name": "Test api with callouts and mermaid plugin",
    "description": "<h2>looks cool</h2>\n<p>This is a very long sentence\nthat spans several lines in the YAML\nbut which will be rendered as a string\nwith newlines preserved.</p>\n<h2>Hints</h2>\n<div><h2>2asdasdas</h2><p>asdas asd We would love you to contribute to <code>@octokit/rest</code>, pull requests are very welcome! Please see CONTRIBUTING.md for more information.</p></div>\n<div><p>We would love you to contribute to <code>@octokit/rest</code>, pull requests are very welcome! Please see CONTRIBUTING.md for more information.</p></div>\n<div><p>We would love you to contribute to @octokit/rest, pull requests are very welcome! Please see CONTRIBUTING.md for more information.</p></div>\n<div><p>We would love you to contribute to @octokit/rest, pull requests are very welcome! Please see CONTRIBUTING.md for more information.</p></div>\n<pre><code class=\"language-mermaid\">graph TD;\n    A-->B;\n    A-->C;\n    B-->D;\n    C-->D;\n</code></pre>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Update an existent pet in the store",
          "customType": "Pet",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 10
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "example": "doggie"
            },
            {
              "name": "category",
              "kind": "optional",
              "type": "object",
              "modelRef": "#/components/schemas/Category",
              "customType": "Category",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 1
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "example": "Dogs"
                }
              ]
            },
            {
              "name": "photoUrls",
              "kind": "required",
              "type": "array",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "tags",
              "kind": "optional",
              "type": "array",
              "modelRef": "#/components/schemas/Tag",
              "customType": "Tag[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                }
              ]
            },
            {
              "name": "status",
              "kind": "optional",
              "type": "string<available | pending | sold>",
              "description": "pet status in the store",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/Pet",
          "isExpanded": true
        }
      ],
      "formDataParameters": [
        {
          "name": "id",
          "kind": "optional",
          "type": "integer<int64>",
          "example": 10
        },
        {
          "name": "name",
          "kind": "required",
          "type": "string",
          "example": "doggie"
        },
        {
          "name": "category",
          "kind": "optional",
          "type": "object",
          "modelRef": "#/components/schemas/Category",
          "customType": "Category",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 1
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "example": "Dogs"
            }
          ]
        },
        {
          "name": "photoUrls",
          "kind": "required",
          "type": "array",
          "example": "",
          "itemType": "string",
          "customType": "string[]",
          "itemExample": "",
          "itemDefault": ""
        },
        {
          "name": "tags",
          "kind": "optional",
          "type": "array",
          "modelRef": "#/components/schemas/Tag",
          "customType": "Tag[]",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 0
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "example": ""
            }
          ]
        },
        {
          "name": "status",
          "kind": "optional",
          "type": "string<available | pending | sold>",
          "description": "pet status in the store",
          "example": ""
        }
      ],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "Pet",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 10
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "example": "doggie"
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/Category",
                "customType": "Category",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 1
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": "Dogs"
                  }
                ]
              },
              {
                "name": "photoUrls",
                "kind": "required",
                "type": "array",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "tags",
                "kind": "optional",
                "type": "array",
                "modelRef": "#/components/schemas/Tag",
                "customType": "Tag[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<available | pending | sold>",
                "description": "pet status in the store",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Pet",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid ID supplied",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Pet not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "405",
        "description": "Validation exception",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "gzEye1KzZW9ai8wSKyGpM",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location --request PUT 'https://petstore3.swagger.io/api/v3/pet' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"id\": 0,\n  \"name\": \"\",\n  \"category\": {\n    \"id\": 0,\n    \"name\": \"\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": 0,\n      \"name\": \"\"\n    }\n  ],\n  \"status\": \"\"\n}'"
        },
        {
          "id": "K1aAw4B5utA81NPG5zPau",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://petstore3.swagger.io/api/v3/pet\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "kzqtCHqRtLUtZFcStR9gP",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://petstore3.swagger.io/api/v3/pet\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "imfKQyUpmFyxKC-NXbnVj",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://petstore3.swagger.io/api/v3/pet\"\n\npayload = json.dumps({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "gzEye1KzZW9ai8wSKyGpM"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful operation\n{\n  \"id\": 10,\n  \"name\": \"doggie\",\n  \"category\": {\n    \"id\": 1,\n    \"name\": \"Dogs\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\"\n    }\n  ],\n  \"status\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid ID supplied\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Pet not found\n"
        },
        {
          "id": "response-3-405",
          "language": "405",
          "code": "// Validation exception\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "BcoxcITw8jWwT6palTWYM",
      "type": "h2",
      "children": [
        {
          "text": "looks cool"
        }
      ]
    },
    {
      "id": "lvzndCgYTmNt3q-xLrS5b",
      "type": "paragraph",
      "children": [
        {
          "text": "This is a very long sentence\nthat spans several lines in the YAML\nbut which will be rendered as a string\nwith newlines preserved."
        }
      ]
    },
    {
      "id": "-h_VlE8atA2JUgOYDNQBh",
      "type": "h2",
      "children": [
        {
          "text": "Hints"
        }
      ]
    },
    {
      "id": "_qmccJQUj2VXaFHPZvQLN",
      "type": "callout-v2",
      "data": {},
      "children": [
        {
          "id": "rW1nNJfcOba_0rk70tqjP",
          "type": "h2",
          "children": [
            {
              "text": "2asdasdas"
            }
          ]
        },
        {
          "id": "XWEz9sQkhlTJiBnDQyehX",
          "type": "paragraph",
          "children": [
            {
              "text": "asdas asd We would love you to contribute to "
            },
            {
              "highlight": true,
              "text": "@octokit/rest"
            },
            {
              "text": ", pull requests are very welcome! Please see CONTRIBUTING.md for more information."
            }
          ]
        }
      ]
    },
    {
      "id": "58SiGa9EEt9lK4b07qXZz",
      "type": "callout-v2",
      "data": {
        "type": "info"
      },
      "children": [
        {
          "id": "RzrF38D1ityKPrZOXTun0",
          "type": "paragraph",
          "children": [
            {
              "text": "We would love you to contribute to "
            },
            {
              "highlight": true,
              "text": "@octokit/rest"
            },
            {
              "text": ", pull requests are very welcome! Please see CONTRIBUTING.md for more information."
            }
          ]
        }
      ]
    },
    {
      "id": "nmqdGj1cgD2USi4bYlczC",
      "type": "callout-v2",
      "data": {
        "type": "warning"
      },
      "children": [
        {
          "id": "cjQF4Aqsh_fv1Oi5Bvx7t",
          "type": "paragraph",
          "children": [
            {
              "text": "We would love you to contribute to @octokit/rest, pull requests are very welcome! Please see CONTRIBUTING.md for more information."
            }
          ]
        }
      ]
    },
    {
      "id": "VbILi2pIWzDnOlVjzesi4",
      "type": "callout-v2",
      "data": {
        "type": "success"
      },
      "children": [
        {
          "id": "AiFgiQqdc1jZvboHgUIaV",
          "type": "paragraph",
          "children": [
            {
              "text": "We would love you to contribute to @octokit/rest, pull requests are very welcome! Please see CONTRIBUTING.md for more information."
            }
          ]
        }
      ]
    },
    {
      "id": "kqNMpkVGrP9cLBw2B6obg",
      "type": "mermaid",
      "data": {
        "code": "graph TD;\n    A-->B;\n    A-->C;\n    B-->D;\n    C-->D;"
      },
      "children": [
        {
          "text": ""
        }
      ]
    }
  ]
}