{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-dataset-attach-schema.json",
  "title": "DatasetAttach",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-datasets-api-openapi.yml#/components/schemas/DatasetAttach",
  "properties": {
    "data_source_id": {
      "type": "string",
      "format": "uuid",
      "title": "Data Source Id",
      "description": "Identifier of the uploaded data source to attach to the revision."
    },
    "role": {
      "$ref": "#/$defs/DatasetRole",
      "description": "Role of the file on the revision (e.g. cad_3d for a 3D CAD model, drawing_2d for a 2D drawing).",
      "default": "other"
    },
    "is_primary": {
      "type": "boolean",
      "title": "Is Primary",
      "description": "Whether this dataset is the primary one for the revision.",
      "default": false
    },
    "attributes": {
      "additionalProperties": true,
      "type": "object",
      "title": "Attributes",
      "description": "Free-form metadata for the attachment, as a JSON object.",
      "default": {}
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "data_source_id"
  ],
  "$defs": {
    "DatasetRole": {
      "type": "string",
      "enum": [
        "cad_3d",
        "drawing_2d",
        "mesh",
        "rfq_text",
        "other"
      ],
      "title": "DatasetRole",
      "description": "What a file is to a part revision's analysis: a 3D model, a 2D\ndrawing, a mesh, request-for-quote text, or other. A file of role\n'other' is kept but not used to price the part."
    }
  }
}