{

"components": {
  "schemas": {
    "request": {
      "post": {
        "type": "object",
        "xml": { "name": "/" },
        "properties": {
          "incident": {
            "type": "object",
            "required": ["name"],
            "properties": { "$ref": "incident.json#/components/schemas/request_properties" }
          }
        }
      },
      "put": {
        "type": "object",
        "xml": { "name": "/" },
        "properties": {
          "incident": {
            "type": "object",
            "properties": { "$ref": "incident.json#/components/schemas/request_properties" }
          }
        }
      }
    },
    "request_properties": {
      "name": { "type": "string", "example": "Incident Name" },
      "site_id": { "$ref": "../../components.json#/components/common/schemas/association_by_id" },
      "department_id": { "$ref": "../../components.json#/components/common/schemas/association_by_id" },
      "description": { "$ref": "../../components.json#/components/common/schemas/string_or_null" },
      "state_id": { "$ref": "../../components.json#/components/common/schemas/association_by_id" },
      "assignee": { "$ref": "../../components.json#/components/request/schemas/association_by_email" },
      "assignee_id": { "$ref": "../../components.json#/components/common/schemas/association_by_id" },
      "priority": { "$ref": "../../components.json#/components/common/schemas/association_by_id" },
      "requester": { "$ref": "../../components.json#/components/request/schemas/association_by_email" },
      "category": { "$ref": "../../components.json#/components/request/schemas/association_by_name" },
      "subcategory": { "$ref": "../../components.json#/components/request/schemas/association_by_name" },
      "due_at": { "type": "string", "example": "Jan 01,2025" },
      "add_to_tag_list": { "type": "string", "example": "tag1, tag2" },
      "remove_from_tag_list": { "type": "string", "example": "tag3" },
      "tag_list": { "type": "string", "example": "tag1, tag2" },
      "custom_fields_values": { "$ref": "../../components.json#/components/request/schemas/custom_fields_values" },
      "custom_fields_values_attributes": { "$ref": "../../components.json#/components/request/schemas/custom_fields_values_attributes" },
      "incidents": { "$ref": "../../components.json#/components/request/schemas/attachment_numbers" },
      "solutions": { "$ref": "../../components.json#/components/request/schemas/attachment_numbers" },
      "changes": { "$ref": "../../components.json#/components/request/schemas/attachment_numbers" },
      "problems": {
        "description": "Incident can have only one Problem associated",
        "anyOf": [
          { "$ref": "../../components.json#/components/request/schemas/number_property" },
          {
            "type": "array",
            "maxItems": 1,
            "items": { "$ref": "../../components.json#/components/request/schemas/number_property" }
          }
        ]
      },
      "releases": { "$ref": "../../components.json#/components/request/schemas/attachment_numbers" },
      "configuration_item_ids": { "$ref": "../../components.json#/components/common/schemas/ids_array" },
      "cc": { "$ref": "../../components.json#/components/request/schemas/cc_array" }
    },
    "response": {
      "type": "object",
      "xml": { "name": "/", "wrapped": true },
      "properties": {
        "incident": {
          "type": "object",
          "properties": {
            "id": { "$ref": "../../components.json#/components/response/schemas/id" },
            "name": { "type": "string", "example": "Incident Name" },
            "description": { "type": "string", "example": "description" },
            "site": { "$ref": "../../components.json#/components/response/schemas/site_response" },
            "department": { "$ref": "../../components.json#/components/response/schemas/department_response" },
            "state": { "type": "string", "example": "New" },
            "priority": { "type": "string", "example": "High" },
            "assignee": { "$ref": "../../components.json#/components/response/schemas/group_details" },
            "requester": { "$ref": "../../components.json#/components/response/schemas/user_details" },
            "category": { "$ref": "../../components.json#/components/response/schemas/category_subcategory" },
            "subcategory": { "$ref": "../../components.json#/components/response/schemas/category_subcategory" },
            "due_at": { "type": "string", "example": "Jan 01,2025" },
            "custom_fields_values": { "$ref": "../../components.json#/components/response/schemas/custom_fields_values" },
            "created_by": { "$ref": "../../components.json#/components/response/schemas/user_details" },
            "origin": { "type": "string", "example": "api" },
            "incidents": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "solutions": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "changes": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "problems": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "releases": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "configuration_items": { "$ref": "../../components.json#/components/response/schemas/response_attachments" },
            "is_service_request": { "type": "boolean", "example": true },
            "cc": { "$ref": "../../components.json#/components/request/schemas/cc_array" }
          }
        }
      }
    }
  }
}

}