{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "./ClientConfigFile.schema.json",
  "title": "ClientConfigFile",
  "description": "Configuration file identified by its $schema URL.",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "const": "https://eudiplo.dev/schemas/v1/ClientConfigFile.schema.json"
        },
        "metadata": {
          "type": "object",
          "properties": {
            "generation": {
              "type": "integer",
              "minimum": 1,
              "description": "Monotonically increasing configuration generation."
            },
            "ownership": {
              "type": "string",
              "enum": [
                "unmanaged",
                "file-managed"
              ],
              "description": "Requested ownership recorded when the document is applied."
            }
          },
          "additionalProperties": false
        },
        "spec": {
          "allOf": [
            {
              "$ref": "./CreateClientDto.schema.json"
            },
            {
              "type": "object",
              "required": [
                "clientId"
              ],
              "properties": {
                "clientId": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          ]
        }
      },
      "required": [
        "$schema",
        "spec"
      ],
      "additionalProperties": false
    }
  ]
}
