{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://modele-donnees-filiere-enquete.insee.fr/specs/2.3.0/FlexibleKeyValueMap.json",
  "title": "FlexibleKeyValueMap",
  "description": "Un tableau contenant plusieurs FlexibleKeyValueMapEntry",
  "type": "array",
  "items": {
    "oneOf": [
      {
        "type": "object",
        "title": "EntryStringVal",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "string"
          }
        },
        "required": [
          "key",
          "value",
          "type"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "title": "EntryBooleanVal",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "const": "boolean"
          }
        },
        "required": [
          "key",
          "value",
          "type"
        ],
        "additionalProperties": false
      }
    ],
    "discriminator": {
      "propertyName": "type",
      "mapping": {
        "string": "#/$defs/EntryStringVal",
        "boolean": "#/$defs/EntryBooleanVal"
      }
    }
  },
  "$defs": {
    "FlexibleKeyValueMapEntry": {
      "oneOf": [
        {
          "type": "object",
          "title": "EntryStringVal",
          "properties": {
            "key": {
              "type": "string"
            },
            "value": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "const": "string"
            }
          },
          "required": [
            "key",
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "EntryBooleanVal",
          "properties": {
            "key": {
              "type": "string"
            },
            "value": {
              "type": "boolean"
            },
            "type": {
              "type": "string",
              "const": "boolean"
            }
          },
          "required": [
            "key",
            "value",
            "type"
          ],
          "additionalProperties": false
        }
      ],
      "discriminator": {
        "propertyName": "type",
        "mapping": {
          "string": "#/$defs/EntryStringVal",
          "boolean": "#/$defs/EntryBooleanVal"
        }
      }
    },
    "EntryStringVal": {
      "type": "object",
      "title": "EntryStringVal",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "string"
        }
      },
      "required": [
        "key",
        "value",
        "type"
      ],
      "additionalProperties": false
    },
    "EntryBooleanVal": {
      "type": "object",
      "title": "EntryBooleanVal",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "const": "boolean"
        }
      },
      "required": [
        "key",
        "value",
        "type"
      ],
      "additionalProperties": false
    }
  }
}