{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/optum/json-schema/optum-attachment-request-schema.json",
  "title": "AttachmentRequest",
  "description": "FHIR Parameters resource for attachment submission",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optum-submitattachment-api-openapi.yml#/components/schemas/AttachmentRequest",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string"
    },
    "parameter": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Parameter"
      }
    }
  },
  "$defs": {
    "Attachment": {
      "type": "object",
      "description": "Attachment content details",
      "properties": {
        "contentType": {
          "type": "string"
        },
        "creation": {
          "type": "string"
        },
        "data": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "Content": {
      "type": "object",
      "properties": {
        "attachment": {
          "$ref": "#/$defs/Attachment"
        }
      }
    },
    "DocumentReference": {
      "type": "object",
      "description": "FHIR DocumentReference used inside attachment",
      "properties": {
        "resourceType": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Content"
          }
        }
      }
    },
    "Identifier": {
      "type": "object",
      "properties": {
        "system": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "Parameter": {
      "type": "object",
      "description": "Parameter entry in Parameters resource",
      "properties": {
        "name": {
          "type": "string"
        },
        "valueIdentifier": {
          "$ref": "#/$defs/Identifier"
        },
        "valueCode": {
          "type": "string"
        },
        "part": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ParameterPart"
          }
        }
      }
    },
    "ParameterPart": {
      "type": "object",
      "description": "Nested parameter part (used for Attachment)",
      "properties": {
        "name": {
          "type": "string"
        },
        "resource": {
          "$ref": "#/$defs/DocumentReference"
        }
      }
    }
  }
}