{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "Unique attribute provider identifier."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name of the attribute provider."
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional attribute provider description."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Base URL of the attribute provider endpoint."
    },
    "auth": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "none",
              "description": "Disable authentication for attribute provider calls."
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false,
          "description": "No authentication variant."
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "apiKey",
              "description": "Use API key authentication."
            },
            "config": {
              "type": "object",
              "properties": {
                "headerName": {
                  "type": "string",
                  "minLength": 1,
                  "description": "HTTP header name carrying the API key."
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "description": "API key value."
                }
              },
              "required": [
                "headerName",
                "value"
              ],
              "additionalProperties": false,
              "description": "API key authentication settings."
            }
          },
          "required": [
            "type",
            "config"
          ],
          "additionalProperties": false,
          "description": "API key authentication variant."
        }
      ],
      "description": "Authentication configuration for outbound provider requests."
    }
  },
  "required": [
    "id",
    "name",
    "url",
    "auth"
  ],
  "additionalProperties": false,
  "$id": "./CreateAttributeProviderDto.schema.json",
  "title": "CreateAttributeProviderDto"
}
