{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://imde.io/schema/azlon/1.0/attributes/attributes.json",
  "title": "DataTopic_Attributes",
  "$comment": "Source XSD: https://imde.io/schema/azlon/1.0/attributes/attributes.xsd",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "Attributes": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "Attribute": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "Codes": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "Code": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Type": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/attributeCodeType.json"
                        }
                      },
                      "required": [
                        "Value",
                        "Type"
                      ]
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "Code"
                ]
              },
              "Names": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "Translation": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Culture": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/culture.json"
                        }
                      },
                      "required": [
                        "Value",
                        "Culture"
                      ]
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "Translation"
                ]
              },
              "Values": {
                "type": "object",
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "Value"
                    ],
                    "not": {
                      "required": [
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueString"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueMultilinePlainText"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueInteger"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueDouble"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueNumber",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueNumber"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueDate",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueDate"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueBoolean"
                      ]
                    }
                  },
                  {
                    "required": [
                      "ValueBoolean"
                    ],
                    "not": {
                      "required": [
                        "Value",
                        "ValueString",
                        "ValueMultilinePlainText",
                        "ValueInteger",
                        "ValueDouble",
                        "ValueNumber",
                        "ValueDate"
                      ]
                    }
                  }
                ],
                "properties": {
                  "Units": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "Unit": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "Value": {
                              "type": "string"
                            },
                            "Type": {
                              "$ref": "https://imde.io/schema/azlon/1.0/codelists/unitType.json"
                            }
                          },
                          "required": [
                            "Value",
                            "Type"
                          ]
                        },
                        "minItems": 1
                      }
                    },
                    "required": [
                      "Unit"
                    ]
                  },
                  "Value": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Type": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/attributeValueType.json"
                        }
                      },
                      "required": [
                        "Value",
                        "Type"
                      ]
                    },
                    "minItems": 1
                  },
                  "ValueString": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Culture": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/culture.json"
                        }
                      },
                      "required": [
                        "Value"
                      ]
                    },
                    "minItems": 1
                  },
                  "ValueMultilinePlainText": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Culture": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/culture.json"
                        }
                      },
                      "required": [
                        "Value"
                      ]
                    },
                    "minItems": 1
                  },
                  "ValueInteger": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "minItems": 1
                  },
                  "ValueDouble": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 1
                  },
                  "ValueNumber": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 1
                  },
                  "ValueDate": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 1
                  },
                  "ValueBoolean": {
                    "type": "array",
                    "items": {
                      "type": "boolean"
                    },
                    "minItems": 1
                  }
                }
              },
              "Type": {
                "$ref": "https://imde.io/schema/azlon/1.0/codelists/attributeType.json"
              },
              "AttributeGroupCode": {
                "type": "string"
              },
              "IsPublic": {
                "type": "boolean"
              }
            },
            "required": [
              "Codes",
              "Names",
              "Values",
              "Type",
              "IsPublic"
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "Attribute"
      ]
    },
    "AttributeGroups": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "AttributeGroup": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "Names": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "Translation": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "Value": {
                          "type": "string"
                        },
                        "Culture": {
                          "$ref": "https://imde.io/schema/azlon/1.0/codelists/culture.json"
                        }
                      },
                      "required": [
                        "Value",
                        "Culture"
                      ]
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "Translation"
                ]
              },
              "Code": {
                "type": "string"
              }
            },
            "required": [
              "Names",
              "Code"
            ]
          },
          "minItems": 1
        }
      },
      "required": [
        "AttributeGroup"
      ]
    }
  },
  "required": [
    "Attributes"
  ]
}
