How to generate JSON examples from OpenAPI/Swagger model definition?
<p>I'm building a fuzzer for a REST API that has an OpenAPI (Swagger) definition.</p>

<p>I want to test all available path from the OpenAPI definition, generate data to test the servers, analyse responses code and content, and to verify if the responses are conform to the API definition. </p>

<p>I'm looking for a way to generate data (JSON object) from model definitions. </p>

<p>For example, given this model:</p>

<pre class="lang-js prettyprint-override"><code>...
"Pet": {
  "type": "object",
  "required": [
    "name",
    "photoUrls"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "category": {
      "$ref": "#/definitions/Category"
    },
    "name": {
      "type": "string",
      "example": "doggie"
    },
    "photoUrls": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Tag"
      }
    },
    "status": {
      "type": "string",
      "description": "pet status in the store"
    }
  }
}
</code></pre>

<p>I want to generate random data and get something like this: </p>

<pre><code>{
  "id": 0,
  "category": {
    "id": 0,
    "name": "string"
  },
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "string"
}
</code></pre>