{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/balancos-ai/json-schema/balancos-ai-apps-api-cvm-modelos-envelope-ranking-schema.json",
  "title": "EnvelopeRanking",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/balancos-ai-openapi.json#/components/schemas/apps__api__cvm__modelos__EnvelopeRanking",
  "properties": {
    "dados": {
      "$ref": "#/$defs/apps__api__cvm__modelos__Ranking"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "dados",
    "meta"
  ],
  "$defs": {
    "CompanhiaRanking": {
      "properties": {
        "posicao": {
          "type": "integer",
          "title": "Posicao"
        },
        "cnpj": {
          "type": "string",
          "title": "Cnpj"
        },
        "cd_cvm": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cd Cvm"
        },
        "denominacao": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Denominacao"
        },
        "valor_em_reais": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Valor Em Reais"
        },
        "versao": {
          "type": "integer",
          "title": "Versao"
        },
        "id_doc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id Doc"
        },
        "empresa": {
          "anyOf": [
            {
              "$ref": "#/$defs/EmpresaResumo"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "posicao",
        "cnpj",
        "cd_cvm",
        "denominacao",
        "valor_em_reais",
        "versao",
        "id_doc",
        "empresa"
      ],
      "title": "CompanhiaRanking"
    },
    "EmpresaResumo": {
      "properties": {
        "razao_social": {
          "type": "string",
          "title": "Razao Social"
        },
        "slug": {
          "type": "string",
          "title": "Slug"
        },
        "link": {
          "type": "string",
          "title": "Link"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "razao_social",
        "slug",
        "link"
      ],
      "title": "EmpresaResumo",
      "description": "`{razao_social, slug, link}` — o ponteiro leve usado dentro de\nbalanços, DREs e documentos."
    },
    "Meta": {
      "properties": {
        "versao": {
          "type": "string",
          "title": "Versao",
          "default": "v1"
        },
        "release": {
          "type": "string",
          "title": "Release",
          "default": "1.3.0"
        },
        "dados_atualizados_em": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dados Atualizados Em"
        },
        "requisicao_id": {
          "type": "string",
          "title": "Requisicao Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "dados_atualizados_em",
        "requisicao_id"
      ],
      "title": "Meta"
    },
    "apps__api__cvm__modelos__Ranking": {
      "properties": {
        "metrica": {
          "type": "string",
          "title": "Metrica"
        },
        "exercicio": {
          "type": "integer",
          "title": "Exercicio"
        },
        "visao": {
          "type": "string",
          "title": "Visao"
        },
        "familia": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Familia"
        },
        "inicio": {
          "type": "integer",
          "title": "Inicio"
        },
        "total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total"
        },
        "proximo_inicio": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proximo Inicio"
        },
        "companhias": {
          "items": {
            "$ref": "#/$defs/CompanhiaRanking"
          },
          "type": "array",
          "title": "Companhias"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "metrica",
        "exercicio",
        "visao",
        "familia",
        "inicio",
        "total",
        "proximo_inicio",
        "companhias"
      ],
      "title": "Ranking"
    }
  }
}