{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obm-com-br/json-schema/obm-com-br-etf-detail-envelope-schema.json",
  "title": "EtfDetailEnvelope",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obm-com-br-openapi.yml#/components/schemas/EtfDetailEnvelope",
  "properties": {
    "data": {
      "$ref": "#/$defs/EtfDetail",
      "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": {
    "EtfDetail": {
      "properties": {
        "ticker": {
          "type": "string",
          "title": "Ticker"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "instrument_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Instrument Type"
        },
        "sector": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sector"
        },
        "segment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Segment"
        },
        "latest_close": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latest Close"
        },
        "latest_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latest Date"
        },
        "change_1d_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Change 1D Ratio"
        },
        "market_cap_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Market Cap Brl"
        },
        "dy_12m_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dy 12M Ratio"
        },
        "pvp_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pvp Ratio"
        },
        "avg_volume_30d_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Volume 30D Brl"
        },
        "isin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Isin"
        },
        "currency_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency Code"
        },
        "cnpj": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj"
        },
        "manager": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Manager"
        },
        "administrator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Administrator"
        },
        "global_fee_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Global Fee Ratio"
        },
        "pl_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pl Ratio"
        },
        "ev_ebitda": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ev Ebitda"
        },
        "fee_details": {
          "anyOf": [
            {
              "$ref": "#/$defs/EtfFeeView"
            },
            {
              "type": "null"
            }
          ]
        },
        "reference_index": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reference Index"
        },
        "tracking_error_12m_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tracking Error 12M Ratio"
        },
        "aum_brl": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aum Brl"
        },
        "aum_reference_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aum Reference Date"
        }
      },
      "type": "object",
      "required": [
        "ticker",
        "name"
      ],
      "title": "EtfDetail"
    },
    "EtfFeeView": {
      "properties": {
        "show_decomposition": {
          "type": "boolean",
          "title": "Show Decomposition",
          "default": false
        },
        "source_label": {
          "type": "string",
          "title": "Source Label"
        },
        "headline_label": {
          "type": "string",
          "title": "Headline Label"
        },
        "state": {
          "type": "string",
          "title": "State"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        },
        "annual_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Annual Ratio"
        },
        "components": {
          "items": {
            "$ref": "#/$defs/FeeComponentView"
          },
          "type": "array",
          "title": "Components"
        },
        "freshness_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Freshness Label"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "sha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sha256"
        },
        "document_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Document Date"
        },
        "read_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Read At"
        }
      },
      "type": "object",
      "required": [
        "source_label",
        "headline_label",
        "state",
        "reason"
      ],
      "title": "EtfFeeView"
    },
    "FeeComponentView": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "nature_label": {
          "type": "string",
          "title": "Nature Label"
        },
        "annual_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Annual Ratio"
        },
        "included_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Included Label"
        },
        "conditions": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Conditions"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        },
        "evidence": {
          "items": {
            "$ref": "#/$defs/FeeEvidence"
          },
          "type": "array",
          "title": "Evidence"
        }
      },
      "type": "object",
      "required": [
        "label",
        "nature_label",
        "annual_ratio",
        "included_label",
        "conditions",
        "reason",
        "evidence"
      ],
      "title": "FeeComponentView"
    },
    "FeeEvidence": {
      "properties": {
        "page": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Page"
        },
        "excerpt": {
          "type": "string",
          "maxLength": 900,
          "minLength": 1,
          "title": "Excerpt"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "page",
        "excerpt"
      ],
      "title": "FeeEvidence"
    },
    "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"
    }
  }
}