{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "Prenom": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Prenom": {
              "type": "string"
            }
          },
          "required": [
            "Prenom"
          ]
        }
      ]
    },
    "Alias": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Alias": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "Alias"
          ]
        }
      ]
    },
    "Sexe": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Sexe": {
              "type": "string"
            }
          },
          "required": [
            "Sexe"
          ]
        }
      ]
    },
    "DateDeNaissance": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Jour": {
              "type": "string"
            },
            "Mois": {
              "type": "string"
            },
            "Annee": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "Annee"
          ]
        }
      ]
    },
    "LieuDeNaissance": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Lieu": {
              "type": "string"
            },
            "Pays": {
              "type": "string"
            }
          }
        }
      ]
    },
    "Nationalite": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Pays": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "Pays"
          ]
        }
      ]
    },
    "Titre": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Titre": {
              "type": "string"
            }
          },
          "required": [
            "Titre"
          ]
        }
      ]
    },
    "Adresse": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Adresse": {
              "type": "string"
            },
            "Pays": {
              "type": "string"
            }
          }
        }
      ]
    },
    "AutreIdentite": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "NumeroCarte": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "NumeroCarte"
          ]
        }
      ]
    },
    "Passeport": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "NumeroPasseport": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "NumeroPasseport"
          ]
        }
      ]
    },
    "Cryptomonnaie": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Cryptomonnaie": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "Cryptomonnaie"
          ]
        }
      ]
    },
    "Motifs": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Motifs": {
              "type": "string"
            }
          },
          "required": [
            "Motifs"
          ]
        }
      ]
    },
    "FondementJuridique": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "FondementJuridique": {
              "type": "integer"
            },
            "FondementJuridiqueLabel": {
              "type": "string"
            }
          },
          "required": [
            "FondementJuridique",
            "FondementJuridiqueLabel"
          ]
        }
      ]
    },
    "ReferenceUe": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "ReferenceUe": {
              "type": "string"
            }
          },
          "required": [
            "ReferenceUe"
          ]
        }
      ]
    },
    "ReferenceOnu": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "ReferenceOnu": {
              "type": "string"
            }
          },
          "required": [
            "ReferenceOnu"
          ]
        }
      ]
    },
    "Identification": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Identification": {
              "type": "string"
            },
            "Commentaire": {
              "type": "string"
            }
          },
          "required": [
            "Identification"
          ]
        }
      ]
    },
    "Telephone": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Telephone": {
              "type": "string"
            }
          },
          "required": [
            "Telephone"
          ]
        }
      ]
    },
    "SiteInternet": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "SiteInternet": {
              "type": "string"
            }
          },
          "required": [
            "SiteInternet"
          ]
        }
      ]
    },
    "Courriel": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "Courriel": {
              "type": "string"
            }
          },
          "required": [
            "Courriel"
          ]
        }
      ]
    },
    "NumeroOMI": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "NumeroOMI": {
              "type": "string"
            }
          },
          "required": [
            "NumeroOMI"
          ]
        }
      ]
    }
  },
  "type": "object",
  "properties": {
    "Publications": {
      "type": "object",
      "properties": {
        "DatePublication": {
          "type": "string"
        },
        "PublicationDetail": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "IdRegistre": {
                    "type": "number"
                  },
                  "Nature": {
                    "enum": [
                      "Personne physique"
                    ]
                  },
                  "Nom": {
                    "type": "string"
                  },
                  "RegistreDetail": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "TypeChamp": {
                              "enum": [
                                "PRENOM",
                                "ALIAS",
                                "SEXE",
                                "DATE_DE_NAISSANCE",
                                "LIEU_DE_NAISSANCE",
                                "NATIONALITE",
                                "TITRE",
                                "ADRESSE_PP",
                                "AUTRE_IDENTITE",
                                "PASSEPORT",
                                "CRYPTOMONNAIE",
                                "MOTIFS",
                                "FONDEMENT_JURIDIQUE",
                                "REFERENCE_UE",
                                "REFERENCE_ONU"
                              ]
                            },
                            "Valeur": {
                              "anyOf": [
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "PRENOM"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Prenom"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "ALIAS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Alias"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "SEXE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Sexe"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "DATE_DE_NAISSANCE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/DateDeNaissance"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "LIEU_DE_NAISSANCE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/LieuDeNaissance"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "NATIONALITE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Nationalite"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "TITRE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Titre"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "ADRESSE_PP"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Adresse"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "AUTRE_IDENTITE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/AutreIdentite"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "PASSEPORT"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Passeport"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "CRYPTOMMONNAIE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Cryptomonnaie"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "MOTIFS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Motifs"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "FONDEMENT_JURIDIQUE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/FondementJuridique"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "REFERENCE_UE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceUe"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "REFERENCE_ONU"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceOnu"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "TypeChamp",
                            "Valeur"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "IdRegistre",
                  "Nature",
                  "Nom",
                  "RegistreDetail"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "IdRegistre": {
                    "type": "number"
                  },
                  "Nature": {
                    "enum": [
                      "Personne morale"
                    ]
                  },
                  "Nom": {
                    "type": "string"
                  },
                  "RegistreDetail": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "TypeChamp": {
                              "enum": [
                                "ALIAS",
                                "IDENTIFICATION",
                                "ADRESSE_PM",
                                "TELEPHONE",
                                "SITE_INTERNET",
                                "COURRIEL",
                                "CRYPTOMONNAIE",
                                "MOTIFS",
                                "FONDEMENT_JURIDIQUE",
                                "REFERENCE_UE",
                                "REFERENCE_ONU"
                              ]
                            },
                            "Valeur": {
                              "anyOf": [
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "ALIAS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Alias"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "IDENTIFICATION"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Identification"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "ADRESSE_PM"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Adresse"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "TELEPHONE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Telephone"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "SITE_INTERNET"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/SiteInternet"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "COURRIEL"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Courriel"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "CRYPTOMMONNAIE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Cryptomonnaie"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "MOTIFS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Motifs"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "FONDEMENT_JURIDIQUE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/FondementJuridique"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "enconstm": "REFERENCE_UE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceUe"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "REFERENCE_ONU"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceOnu"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "TypeChamp",
                            "Valeur"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "IdRegistre",
                  "Nature",
                  "Nom",
                  "RegistreDetail"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "IdRegistre": {
                    "type": "number"
                  },
                  "Nature": {
                    "enum": [
                      "Navire"
                    ]
                  },
                  "Nom": {
                    "type": "string"
                  },
                  "RegistreDetail": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "TypeChamp": {
                              "enum": [
                                "ALIAS",
                                "NUMERO_OMI",
                                "IDENTIFICATION",
                                "MOTIFS",
                                "FONDEMENT_JURIDIQUE",
                                "REFERENCE_UE",
                                "REFERENCE_ONU"
                              ]
                            },
                            "Valeur": {
                              "anyOf": [
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "ALIAS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Alias"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "NUMERO_OMI"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/NumeroOMI"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "IDENTIFICATION"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Identification"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "MOTIFS"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/Motifs"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "FONDEMENT_JURIDIQUE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/FondementJuridique"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "REFERENCE_UE"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceUe"
                                  }
                                },
                                {
                                  "if": {
                                    "properties": {
                                      "TypeChamp": {
                                        "const": "REFERENCE_ONU"
                                      }
                                    }
                                  },
                                  "then": {
                                    "$ref": "#/definitions/ReferenceOnu"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "TypeChamp",
                            "Valeur"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "IdRegistre",
                  "Nature",
                  "Nom",
                  "RegistreDetail"
                ]
              }
            ]
          }
        }
      },
      "required": [
        "DatePublication",
        "PublicationDetail"
      ]
    }
  },
  "required": [
    "Publications"
  ]
}