{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/centaur-labs/json-schema/centaur-labs-set-pre-label-request-schema.json",
  "title": "SetPreLabelRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/centaur-labs-add-and-manage-labels-api-openapi.yml#/components/schemas/SetPreLabelRequest",
  "properties": {
    "labels": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/LabelRange"
          },
          {
            "$ref": "#/$defs/LabelUUID"
          },
          {
            "$ref": "#/$defs/LabelSegmentation"
          }
        ]
      },
      "type": "array",
      "minItems": 1,
      "title": "Labels"
    }
  },
  "type": "object",
  "required": [
    "labels"
  ],
  "$defs": {
    "LabelRange": {
      "properties": {
        "case_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Case Id"
        },
        "content_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Id"
        },
        "origin": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 250,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Origin"
        },
        "answer": {
          "items": {
            "$ref": "#/$defs/RangeAnswer"
          },
          "type": "array",
          "title": "Answer",
          "unique_items": true
        }
      },
      "type": "object",
      "required": [
        "answer"
      ],
      "title": "LabelRange"
    },
    "LabelSegmentation": {
      "properties": {
        "case_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Case Id"
        },
        "content_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Id"
        },
        "origin": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 250,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Origin"
        },
        "answer": {
          "items": {
            "$ref": "#/$defs/SegmentationAnswer"
          },
          "type": "array",
          "title": "Answer",
          "unique_items": true
        }
      },
      "type": "object",
      "required": [
        "answer"
      ],
      "title": "LabelSegmentation"
    },
    "LabelUUID": {
      "properties": {
        "case_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Case Id"
        },
        "content_id": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Id"
        },
        "origin": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 250,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Origin"
        },
        "answer": {
          "items": {
            "$ref": "#/$defs/UUIDAnswer"
          },
          "type": "array",
          "title": "Answer",
          "unique_items": true
        }
      },
      "type": "object",
      "required": [
        "answer"
      ],
      "title": "LabelUUID"
    },
    "RangeAnswer": {
      "properties": {
        "answer_class": {
          "type": "string",
          "title": "Answer Class"
        },
        "ranges": {
          "items": {
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "type": "array",
            "maxItems": 2,
            "minItems": 2
          },
          "type": "array",
          "minItems": 1,
          "title": "Ranges"
        },
        "freetexts": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "unique_items": true
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Freetexts"
        }
      },
      "type": "object",
      "required": [
        "answer_class",
        "ranges"
      ],
      "title": "RangeAnswer"
    },
    "SegmentationAnswer": {
      "properties": {
        "answer_class": {
          "type": "string",
          "title": "Answer Class"
        },
        "geometries": {
          "items": {
            "type": "string",
            "minLength": 1
          },
          "type": "array",
          "minItems": 1,
          "title": "Geometries",
          "unique_items": true
        },
        "freetexts": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "unique_items": true
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Freetexts"
        }
      },
      "type": "object",
      "required": [
        "answer_class",
        "geometries"
      ],
      "title": "SegmentationAnswer"
    },
    "UUIDAnswer": {
      "properties": {
        "answer_class": {
          "type": "string",
          "title": "Answer Class"
        },
        "mask_uuid": {
          "type": "string",
          "format": "uuid",
          "title": "Mask Uuid"
        }
      },
      "type": "object",
      "required": [
        "answer_class",
        "mask_uuid"
      ],
      "title": "UUIDAnswer"
    }
  }
}