{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obm-com-br/json-schema/obm-com-br-bond-list-envelope-schema.json",
  "title": "BondListEnvelope",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obm-com-br-openapi.yml#/components/schemas/BondListEnvelope",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/Bond"
      },
      "type": "array",
      "title": "Data",
      "description": "Dados da resposta. Os exemplos são ilustrativos e não representam cotações atuais."
    },
    "reference_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reference Date",
      "description": "Data do dado no formato AAAA-MM-DD (RFC 3339); null quando não há data verificável. Nunca é a data da chamada."
    },
    "source": {
      "$ref": "#/$defs/Source"
    },
    "meta": {
      "anyOf": [
        {
          "$ref": "#/$defs/Pagination"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "data",
    "reference_date",
    "source"
  ],
  "$defs": {
    "Bond": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "type": {
          "type": "string",
          "enum": [
            "cri",
            "cra",
            "debenture",
            "tesouro"
          ],
          "title": "Type"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "matured",
            "redeemed",
            "defaulted",
            "suspended",
            "cancelled"
          ],
          "title": "Status"
        },
        "isin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Isin"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "issuer_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issuer Name"
        },
        "issuer_cnpj": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issuer Cnpj"
        },
        "debtor_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Debtor Name"
        },
        "sector": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sector"
        },
        "series": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Series"
        },
        "issue_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issue Number"
        },
        "issue_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issue Date"
        },
        "accrual_start_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Accrual Start Date"
        },
        "maturity_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Maturity Date"
        },
        "indexer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Indexer"
        },
        "spread_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Spread Ratio"
        },
        "fixed_rate_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fixed Rate Ratio"
        },
        "day_count": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Day Count"
        },
        "nominal_value_at_issue_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nominal Value At Issue Brl"
        },
        "issued_quantity": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issued Quantity"
        },
        "issued_volume_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issued Volume Brl"
        },
        "incentivized": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Incentivized"
        },
        "guarantee_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Guarantee Type"
        },
        "collateral_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collateral Type"
        },
        "trustee_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trustee Name"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "reference_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reference Date"
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "code",
        "type",
        "status",
        "url"
      ],
      "title": "Bond"
    },
    "Pagination": {
      "properties": {
        "page": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Page"
        },
        "page_size": {
          "type": "integer",
          "maximum": 200.0,
          "minimum": 1.0,
          "title": "Page Size"
        },
        "total": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Total"
        }
      },
      "type": "object",
      "required": [
        "page",
        "page_size",
        "total"
      ],
      "title": "Pagination"
    },
    "Source": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "url": {
          "type": "string",
          "title": "Url"
        }
      },
      "type": "object",
      "required": [
        "code",
        "name",
        "url"
      ],
      "title": "Source"
    }
  }
}