{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algenta-ai/json-schema/algenta-ai-map-response-schema.json",
  "title": "MapResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algenta-ai-data-mapping-api-openapi.yml#/components/schemas/MapResponse",
  "properties": {
    "map_id": {
      "type": "string",
      "title": "Map Id"
    },
    "sources_analyzed": {
      "type": "integer",
      "title": "Sources Analyzed"
    },
    "total_fields": {
      "type": "integer",
      "title": "Total Fields"
    },
    "mappings": {
      "items": {
        "$ref": "#/$defs/FieldMapping"
      },
      "type": "array",
      "title": "Mappings"
    },
    "unified_schema": {
      "items": {
        "$ref": "#/$defs/SchemaField"
      },
      "type": "array",
      "title": "Unified Schema"
    },
    "join_keys": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Join Keys"
    },
    "derived_relationships": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Derived Relationships"
    },
    "simulation_ready": {
      "type": "boolean",
      "title": "Simulation Ready"
    },
    "simulation_payload": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Payload"
    },
    "deep_analysis_pending": {
      "type": "boolean",
      "title": "Deep Analysis Pending",
      "default": false
    },
    "latency_ms": {
      "type": "number",
      "title": "Latency Ms"
    }
  },
  "type": "object",
  "required": [
    "map_id",
    "sources_analyzed",
    "total_fields",
    "mappings",
    "unified_schema",
    "join_keys",
    "derived_relationships",
    "simulation_ready",
    "simulation_payload",
    "latency_ms"
  ],
  "$defs": {
    "FieldMapping": {
      "properties": {
        "source_field": {
          "type": "string",
          "title": "Source Field"
        },
        "source": {
          "type": "string",
          "title": "Source"
        },
        "target_field": {
          "type": "string",
          "title": "Target Field"
        },
        "target": {
          "type": "string",
          "title": "Target"
        },
        "confidence": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Confidence"
        },
        "reason": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Reason"
        },
        "match_type": {
          "type": "string",
          "title": "Match Type"
        }
      },
      "type": "object",
      "required": [
        "source_field",
        "source",
        "target_field",
        "target",
        "confidence",
        "reason",
        "match_type"
      ],
      "title": "FieldMapping"
    },
    "SchemaField": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "sources": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Sources"
        },
        "distribution": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Distribution"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit"
        },
        "polarity": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Polarity"
        },
        "sample_values": {
          "items": {},
          "type": "array",
          "title": "Sample Values",
          "default": []
        }
      },
      "type": "object",
      "required": [
        "name",
        "sources"
      ],
      "title": "SchemaField"
    }
  }
}