{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cnpj-ai/json-schema/cnpj-ai-catalogo-fontes-schema.json",
  "title": "CatalogoFontes",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cnpj-ai-v2-openapi.yml#/components/schemas/CatalogoFontes",
  "properties": {
    "versao": {
      "type": "string",
      "const": "v2",
      "title": "Versao",
      "default": "v2"
    },
    "limite_padrao": {
      "type": "integer",
      "title": "Limite Padrao",
      "default": 20
    },
    "limite_maximo": {
      "type": "integer",
      "title": "Limite Maximo",
      "default": 100
    },
    "fontes": {
      "items": {
        "$ref": "#/$defs/DescricaoFonte"
      },
      "type": "array",
      "title": "Fontes"
    }
  },
  "type": "object",
  "required": [
    "fontes"
  ],
  "$defs": {
    "DescricaoFonte": {
      "properties": {
        "nome": {
          "type": "string",
          "title": "Nome"
        },
        "tema": {
          "type": "string",
          "title": "Tema"
        },
        "escopo_dos_registros": {
          "type": "string",
          "enum": [
            "empresa",
            "estabelecimento"
          ],
          "title": "Escopo Dos Registros"
        },
        "proveniencia": {
          "$ref": "#/$defs/Proveniencia"
        }
      },
      "type": "object",
      "required": [
        "nome",
        "tema",
        "escopo_dos_registros",
        "proveniencia"
      ],
      "title": "DescricaoFonte"
    },
    "Proveniencia": {
      "properties": {
        "fonte": {
          "type": "string",
          "title": "Fonte"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "nota": {
          "type": "string",
          "title": "Nota"
        },
        "licenca": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Licenca"
        },
        "licenca_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Licenca Url"
        },
        "metodologia_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metodologia Url"
        }
      },
      "type": "object",
      "required": [
        "fonte",
        "url",
        "nota"
      ],
      "title": "Proveniencia"
    }
  }
}