Swagger: Reuse schema definition inside object property
<p>Problem: I want to reuse a definiton. Once directly and once inside an object. The following code works but the validator from <a href="http://editor.swagger.io/#/" rel="nofollow noreferrer">http://editor.swagger.io/#/</a> is saying "Not a valid response definition" and pointing to the line "200".</p>

<p>Do I really have to define Account twice? Or is this an issue form the validator?</p>

<pre><code> *     responses:
 *       200: &lt;---- ERROR POINTING HERE
 *         description: Updated account
 *         schema:
 *           type: object
 *           properties:
 *             data:
 *               type: object
 *               properties:
 *                 account:
 *                   schema:
 *                     $ref: '#/definitions/Account'
</code></pre>

<p>The definition itself:</p>

<pre><code> "Account" : {
    "type" : "object",
    "required": [
        "id", "username", "lastname", "firstname", "traderid", "customerid", "company", "validated"
    ],
    "properties": {
        "id": {
            "type": "string"
        },
        "username" : {
            "type": "string"
        },
        "lastname" : {
            "type": "string"
        },
        "firstname" : {
            "type": "string"
        },
        "traderid" : {
            "type": "string"
        },
        "customerid" : {
            "type": "string"
        },
        "company" : {
            "type": "string"
        },
        "validated" : {
            "type": "boolean"
        }
    },
    "example" : {
        "id": "57790fdde3fd3ed82681f39c",
        "username": "yuhucebafu",
        "validated": false,
        "customerid": "57790fdce3fd3ed82681f39a"
    }
},
</code></pre>