fix: update visual container schema URL from 1.5.0 to 2.7.0

Update SCHEMA_VISUAL_CONTAINER constant and all 22 visual template JSON
files to use visualContainer/2.7.0/schema.json instead of 1.5.0.
This commit is contained in:
MinaSaad1 2026-04-01 20:42:12 +02:00
parent a8272926f3
commit eb75d5a198
25 changed files with 568 additions and 3 deletions

View file

@ -25,7 +25,7 @@ SCHEMA_VERSION = (
)
SCHEMA_VISUAL_CONTAINER = (
"https://developer.microsoft.com/json-schemas/"
"fabric/item/report/definition/visualContainer/1.5.0/schema.json"
"fabric/item/report/definition/visualContainer/2.7.0/schema.json"
)
SCHEMA_BOOKMARKS_METADATA = (
"https://developer.microsoft.com/json-schemas/"

View file

@ -0,0 +1 @@
"""PBIR visual templates."""

View file

@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.5.0/schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "areaChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "barChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "card",
"query": {
"queryState": {
"Fields": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "cardNew",
"query": {
"queryState": {
"Fields": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.5.0/schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "columnChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "donutChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "funnelChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "gauge",
"query": {
"queryState": {
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "kpi",
"query": {
"queryState": {
"Indicator": {
"projections": []
},
"Goal": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "lineChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,30 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "lineStackedColumnComboChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"ColumnY": {
"projections": []
},
"LineY": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "multiRowCard",
"query": {
"queryState": {
"Fields": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "pivotTable",
"query": {
"queryState": {
"Rows": {
"projections": []
},
"Values": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "ribbonChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,30 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "scatterChart",
"query": {
"queryState": {
"Details": {
"projections": []
},
"X": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "slicer",
"query": {
"queryState": {
"Values": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "stackedBarChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "tableEx",
"query": {
"queryState": {
"Values": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "treemap",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Values": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "__VISUAL_NAME__",
"position": {
"x": __X__,
"y": __Y__,
"z": __Z__,
"height": __HEIGHT__,
"width": __WIDTH__,
"tabOrder": __TAB_ORDER__
},
"visual": {
"visualType": "waterfallChart",
"query": {
"queryState": {
"Category": {
"projections": []
},
"Y": {
"projections": []
}
}
},
"objects": {},
"drillFilterOtherVisuals": true
}
}

View file

@ -788,3 +788,39 @@ def test_visual_set_container_no_op_returns_no_op_status(
defn, vname = page_with_bar_visual
result = visual_set_container(defn, "test_page", vname)
assert result["status"] == "no-op"
# ---------------------------------------------------------------------------
# Task 1 (bug fix): schema URL must be 2.7.0
# ---------------------------------------------------------------------------
def test_visual_add_uses_correct_schema_version(report_with_page: Path) -> None:
result = visual_add(report_with_page, "test_page", "barChart", x=0, y=0)
vfile = (
report_with_page / "pages" / "test_page" / "visuals"
/ result["name"] / "visual.json"
)
data = json.loads(vfile.read_text())
assert "2.7.0" in data["$schema"]
assert "1.5.0" not in data["$schema"]
# ---------------------------------------------------------------------------
# Task 2 (bug fix): visualGroup containers tagged as type "group"
# ---------------------------------------------------------------------------
def test_visual_list_tags_group_containers_as_group(report_with_page: Path) -> None:
"""visual_list returns visual_type 'group' for visualGroup containers."""
visuals_dir = report_with_page / "pages" / "test_page" / "visuals"
grp_dir = visuals_dir / "grp1"
grp_dir.mkdir()
_write_json(grp_dir / "visual.json", {
"$schema": "https://example.com/schema",
"name": "grp1",
"visualGroup": {"displayName": "Header Group", "visuals": []}
})
results = visual_list(report_with_page, "test_page")
grp = next(r for r in results if r["name"] == "grp1")
assert grp["visual_type"] == "group"