title: Swagger and JSON Patch
body: <p>I have the following object structure in my database</p>
  
  <pre><code>{
      partnerName: '24 Fitness',
      supportedProducts: [
          'FitBit',
          'Protein Powder'
      ]
  },
  </code></pre>
  
  <p>where the key value <strong>supportedProducts</strong> can be modified from the client side.</p>
  
  <p>I am constructing a PATCH API method using swagger documentation to support the above functionality. But I am unsure of the patch object definition, as documentation doesn't provide an detailed example of constructing a PATCH. </p>
  
  <p>The current definition that I have ends up in error upon execution and looks like as following </p>
  
  <pre><code> "patch":{
      "description":"Update supported products for a partner",
      "operationId":"Update supported products",
      "parameters":[
        {
          "name": "partnerName",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "supportedProducts",
          "in": "body",
          "required": true,
          "schema":{
            "$ref":"#/definitions/PatchRequest"
          }
        }
      ],
      "responses":{
        "200":{
          "description": "product updated"
        },
        "404":{
          "description": "Not Found"
        }
      }
  
    "definitions": {
      "PatchRequest":{
        "type": "object",
        "required":[
          "partnerName",
          "supportedProducts"
        ],
        "properties":{
          "partnerName":{"type": "string"},
          "supportedProducts":{
            "type": "array",
            "items":{"type": "string"}
          }
        }
  
      }
    }
  </code></pre>