{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/devarmor/json-schema/devarmor-data-flow-schema.json",
  "title": "DataFlow",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/devarmor-data-flows-api-openapi.yml#/components/schemas/DataFlow",
  "properties": {
    "symbolic_name": {
      "type": "string",
      "pattern": "^[0-9a-z-]+$",
      "title": "Symbolic Name"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "description": {
      "type": "string",
      "title": "Description"
    },
    "has_sensitive_data": {
      "type": "boolean",
      "title": "Has Sensitive Data"
    },
    "encrypted": {
      "type": "boolean",
      "title": "Encrypted"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "project": {
      "$ref": "#/$defs/Project"
    },
    "threat_model_versions": {
      "items": {
        "type": "string",
        "pattern": "^\\d+(\\.\\d+)*$"
      },
      "type": "array",
      "title": "Threat Model Versions"
    },
    "source_type": {
      "$ref": "#/$defs/DataFlowNodeType"
    },
    "source": {
      "anyOf": [
        {
          "$ref": "#/$defs/Component"
        },
        {
          "$ref": "#/$defs/DataStore"
        },
        {
          "$ref": "#/$defs/Actor"
        }
      ],
      "title": "Source"
    },
    "destination_type": {
      "$ref": "#/$defs/DataFlowNodeType"
    },
    "destination": {
      "anyOf": [
        {
          "$ref": "#/$defs/Component"
        },
        {
          "$ref": "#/$defs/DataStore"
        },
        {
          "$ref": "#/$defs/Actor"
        }
      ],
      "title": "Destination"
    }
  },
  "type": "object",
  "required": [
    "symbolic_name",
    "title",
    "description",
    "has_sensitive_data",
    "encrypted",
    "id",
    "project",
    "threat_model_versions",
    "source_type",
    "source",
    "destination_type",
    "destination"
  ],
  "$defs": {
    "Actor": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "type": {
          "$ref": "#/$defs/ActorType"
        },
        "permissions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Permissions"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "$ref": "#/$defs/Project"
        },
        "threat_model_versions": {
          "items": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)*$"
          },
          "type": "array",
          "title": "Threat Model Versions"
        },
        "trust_zone": {
          "anyOf": [
            {
              "$ref": "#/$defs/TrustZone"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "description",
        "type",
        "permissions",
        "id",
        "project",
        "threat_model_versions"
      ],
      "title": "Actor"
    },
    "ActorType": {
      "type": "string",
      "enum": [
        "system",
        "user",
        "power_user",
        "administrator",
        "engineer",
        "third_party"
      ],
      "title": "ActorType"
    },
    "Component": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "repo_link": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2083,
              "minLength": 1,
              "format": "uri"
            },
            {
              "type": "null"
            }
          ],
          "title": "Repo Link"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "$ref": "#/$defs/Project"
        },
        "threat_model_versions": {
          "items": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)*$"
          },
          "type": "array",
          "title": "Threat Model Versions"
        },
        "parent_component": {
          "anyOf": [
            {
              "$ref": "#/$defs/Component"
            },
            {
              "type": "null"
            }
          ]
        },
        "trust_zone": {
          "anyOf": [
            {
              "$ref": "#/$defs/TrustZone"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "description",
        "repo_link",
        "id",
        "project",
        "threat_model_versions",
        "trust_zone"
      ],
      "title": "Component"
    },
    "DataFlowNodeType": {
      "type": "string",
      "enum": [
        "component",
        "data_store",
        "actor"
      ],
      "title": "DataFlowNodeType"
    },
    "DataStore": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "type": {
          "$ref": "#/$defs/DataStoreType"
        },
        "vendor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Vendor"
        },
        "product": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Product"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "$ref": "#/$defs/Project"
        },
        "threat_model_versions": {
          "items": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)*$"
          },
          "type": "array",
          "title": "Threat Model Versions"
        },
        "trust_zone": {
          "anyOf": [
            {
              "$ref": "#/$defs/TrustZone"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "description",
        "type",
        "vendor",
        "product",
        "id",
        "project",
        "threat_model_versions"
      ],
      "title": "DataStore"
    },
    "DataStoreType": {
      "type": "string",
      "enum": [
        "sql",
        "key_value",
        "document",
        "object",
        "graph",
        "time_series"
      ],
      "title": "DataStoreType"
    },
    "Project": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "default": {
          "type": "boolean",
          "title": "Default",
          "default": false
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "use_memory": {
          "type": "boolean",
          "title": "Use Memory",
          "default": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "owner_user": {
          "$ref": "#/$defs/User"
        },
        "memory_effective": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective"
        },
        "memory_effective_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective Reason"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "id",
        "owner_user"
      ],
      "title": "Project"
    },
    "TrustZone": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "$ref": "#/$defs/Project"
        },
        "threat_model_versions": {
          "items": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)*$"
          },
          "type": "array",
          "title": "Threat Model Versions"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "description",
        "id",
        "project",
        "threat_model_versions"
      ],
      "title": "TrustZone"
    },
    "User": {
      "properties": {
        "email": {
          "type": "string",
          "title": "Email"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "state": {
          "$ref": "#/$defs/UserState",
          "default": "active"
        },
        "roles": {
          "items": {
            "$ref": "#/$defs/UserRole"
          },
          "type": "array",
          "title": "Roles",
          "default": []
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        }
      },
      "type": "object",
      "required": [
        "email",
        "name",
        "id"
      ],
      "title": "User"
    },
    "UserRole": {
      "type": "string",
      "enum": [
        "admin",
        "customer_support"
      ],
      "title": "UserRole"
    },
    "UserState": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "pending_org_approval"
      ],
      "title": "UserState"
    }
  }
}