title: How to make a field in a definition required for some operations and not others
body: <p>I'm writing my swagger definition in yaml. Say I have a definition that looks something like this.</p>
  
  <pre><code>paths:
    /payloads:
      post:
        summary: create a payload
        ...
        parameters:
        - in: body
          name: payload
          description: New payload
          required: true
          schema:
            $ref: "#/definitions/payload"
      put:
        summary: update a payload
        ...
        parameters:
        - in: body
          name: payload
          description: Updated existing payload
          required: true
          schema:
            $ref: "#/definitions/payload"
  ...
  definitions:
    payload:
      properties:
        id:
          type: string
        someProperty:
          type: string
        ...
  </code></pre>
  
  <p>Is there a way that I can indicate that the id property of a payload is required for the PUT operation and is optional (or should not appear at all) for the POST operation?</p>