Fix Manifest Json

作者 UI52b8c4a944e39無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Fix manifest.json issues that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs these rules: - `no-outdated-manifest-version` - For _version not being 2.x - `no-legacy-ui5-version-in-manifest` - For minUI5Version below 1.136 - `no-deprecated-library` - For deprecated libraries in dependencies - `no-deprecated-component` - For deprecated components in dependencies - `no-deprecated-api` - For deprecated view types, resources/js, deprecated model types - `no-removed-manifest-property` - For async flags in manifest v2 Trigger on manifest.json files with errors about version, libraries, components, view types. Automatically updates manifest.json to be modern UI5 compatible.

AI 產生的概覽

修復 UI5 linter 回報但無法自動修復的 SAP UI5 manifest.json 問題。

功能
此技能提供修改 SAP UI5 manifest.json 檔案的指示,用來解決 UI5 linter 無法自動修復的規則問題。內容涵蓋將根 _version 更新為 2.0.0、將 minUI5Version 提高到 1.136.0、移除已棄用的程式庫與元件、將已棄用的檢視類型改為 XML、移除已刪除的資訊清單屬性(例如 async 旗標),以及為資訊清單第 2 版重新命名路由屬性。它會產出保留 JSON 格式的更新後 manifest.json,並標記需要後續處理的工作,例如轉換檢視檔案。
適用情境
當 UI5 linter 輸出在 manifest.json 檔案上回報 no-outdated-manifest-version、no-legacy-ui5-version-in-manifest、no-deprecated-library、no-deprecated-component、no-deprecated-api 或 no-removed-manifest-property 等規則時使用。它用於將 manifest.json 現代化,使其相容於現代 UI5。
執行需求
不隨附指令碼,僅為指示文件。需要存取目標 manifest.json 檔案,以及標明待修復規則的 UI5 linter 輸出。

Fix manifest.json

This skill fixes manifest.json issues that the UI5 linter detects but cannot auto-fix because they may require understanding of the application's dependencies and structure.

Linter Rules Handled

Rule IDMessage PatternThis Skill's Action
no-outdated-manifest-versionmanifest.json must be modernized to Version 2Update _version to "2.0.0"
no-legacy-ui5-version-in-manifestUse UI5 version 1.136.0 or higherUpdate minUI5Version to "1.136.0"
no-deprecated-libraryUse of deprecated library '...'Remove from dependencies/libs
no-deprecated-componentUse of deprecated component '...'Remove from dependencies/components
no-deprecated-apiUse of deprecated view type '...'Change to "XML"
no-deprecated-apiUse of deprecated property 'sap.ui5/resources/js'Remove if empty
no-deprecated-apiUse of deprecated class '...' (model types)Flag for manual modernization
no-removed-manifest-propertyProperty '...' has been removed in Manifest Version 2Remove the property

When to Use

Apply this skill when you see linter output like:

manifest.json:2:3 error manifest.json must be modernized to Version 2  no-outdated-manifest-versionmanifest.json:15:5 error Use UI5 version 1.136.0 or higher in manifest.json  no-legacy-ui5-version-in-manifestmanifest.json:20:7 error Use of deprecated library 'sap.ui.commons'  no-deprecated-librarymanifest.json:25:7 error Use of deprecated view type 'JSON'  no-deprecated-apimanifest.json:30:9 error Property '/sap.ui5/rootView/async' has been removed in Manifest Version 2  no-removed-manifest-property

Fix Strategy

1. no-outdated-manifest-version - Update _version to 2.0.0

IMPORTANT: Only update the root _version to "2.0.0". Do NOT change nested _version properties inside sap.app, sap.ui, sap.ui5, etc. — those should remain at their current values (e.g., "1.1.0", "1.2.0").

json
// Before{  "_version": "1.12.0",  "sap.app": {    "_version": "1.1.0",    ...  },  "sap.ui5": {    "_version": "1.2.0",    ...  }}
// After — only root _version changed{  "_version": "2.0.0",  "sap.app": {    "_version": "1.1.0",    ...  },  "sap.ui5": {    "_version": "1.2.0",    ...  }}

After updating to version 2.0.0, you MUST also apply these consequential changes:

  • Remove async properties (see section 6)
  • Rename routing configuration properties (see section 8)
  • Add type: "View" to routing config or targets (see section 8)

2. no-legacy-ui5-version-in-manifest - Update minUI5Version

json
// Before"dependencies": {  "minUI5Version": "1.120.0",  ...}
// After"dependencies": {  "minUI5Version": "1.136.0",  ...}

If minUI5Version is an array, update all entries below 1.136.0.

3. no-deprecated-library - Remove Deprecated Libraries

Remove these deprecated libraries from sap.ui5/dependencies/libs:

  • sap.ui.commons - Use sap.m instead
  • sap.ui.ux3 - Use sap.m and sap.f instead
  • sap.makit - Use sap.viz instead
  • sap.me - Use sap.m instead
  • sap.ca.ui - Use standard controls
  • sap.landvisz - Deprecated
  • sap.ui.vtm - Deprecated
  • sap.sac.grid - Deprecated since 1.112, removed 1.114
  • sap.ui.suite - Deprecated since 1.108
  • sap.zen.commons - Deprecated since 1.89
  • sap.zen.crosstab - Deprecated since 1.89
  • sap.zen.dsh - Deprecated since 1.89
json
// Before"libs": {  "sap.m": {},  "sap.ui.commons": {},  "sap.ui.layout": {}}
// After"libs": {  "sap.m": {},  "sap.ui.layout": {}}

4. no-deprecated-component - Remove Deprecated Components

Remove deprecated components from sap.ui5/dependencies/components.

5. no-deprecated-api - Fix View Types

Change deprecated view types to "XML" (or "Typed" for JS-heavy view cases):

  • JSON → XML
  • HTML → XML
  • JS → XML (or consider Typed view as an alternative for complex JS logic)
  • Template → XML

Applies to:

  • sap.ui5/rootView/type
  • sap.ui5/routing/config/viewType
  • sap.ui5/routing/targets/*/viewType
json
// Before"rootView": {  "viewName": "my.app.view.Main",  "type": "JSON"}
// After"rootView": {  "viewName": "my.app.view.Main",  "type": "XML"}

Important: When changing view types, the actual view file must also be converted to XML format. Flag this for manual review.

6. no-removed-manifest-property - Remove Async Properties (Manifest v2)

In manifest version 2.0.0+, the async flag is implicitly true for the root view and the routing configuration, so it must be removed from exactly these two locations:

  • sap.ui5/rootView/async
  • sap.ui5/routing/config/async
json
// Before (v2)"rootView": {  "viewName": "my.app.view.Main",  "type": "XML",  "async": true}
// After (v2)"rootView": {  "viewName": "my.app.view.Main",  "type": "XML"}

SCOPE WARNING — do NOT remove async from anywhere else. The implicit-async behavior applies only to rootView and routing.config. Other locations where async may legitimately appear (and must be preserved) include:

  • sap.ui5/models/*/settings/async (e.g., OData/JSON model async loading flag)
  • sap.app/dataSources/* settings that include async
  • Any custom configuration under sap.ui5/extends, sap.ui5/componentUsages, or third-party namespaces
  • Any async inside route definitions that is not the top-level routing.config.async

The linter rule no-removed-manifest-property only fires for the two paths above. Trust the linter's pointer — only remove the exact properties it flags.

7. no-deprecated-api - Remove sap.ui5/resources/js

If the array is empty, remove the entire js property (and resources if it becomes empty).

json
// Before"resources": {  "js": []}
// After// (resources section removed if empty)

If not empty, this requires manual modernization to proper module dependencies.

8. Routing Configuration — Rename Properties for Manifest Version 2

When _version is updated to "2.0.0", the routing configuration properties must also be renamed. The view-prefixed property names are deprecated in version 2.

Property renaming rules:

Old Property (v1.x)New Property (v2.0.0)Where
viewPathpathrouting.config
viewNamenamerouting.config and routing.targets.*
viewIdidrouting.targets.*
viewLevellevelrouting.targets.*
viewTypeviewTypeUnchanged — keep as-is

New required property:

PropertyValueWhere
type"View"routing.config (applies to all targets) OR each individual routing.targets.* entry

Before (v1.x):

json
"routing": {    "config": {        "routerClass": "sap.m.routing.Router",        "viewType": "XML",        "viewPath": "my.app.view",        "controlId": "app",        "controlAggregation": "pages",        "async": true    },    "routes": [        {            "name": "main",            "pattern": "",            "target": "main"        }    ],    "targets": {        "main": {            "viewName": "Main",            "viewId": "main",            "viewLevel": 1        },        "detail": {            "viewName": "Detail",            "viewId": "detail",            "viewLevel": 2        }    }}

After (v2.0.0):

json
"routing": {    "config": {        "routerClass": "sap.m.routing.Router",        "viewType": "XML",        "path": "my.app.view",        "controlId": "app",        "controlAggregation": "pages",        "type": "View"    },    "routes": [        {            "name": "main",            "pattern": "",            "target": "main"        }    ],    "targets": {        "main": {            "name": "Main",            "id": "main",            "level": 1        },        "detail": {            "name": "Detail",            "id": "detail",            "level": 2        }    }}

Changes summary:

  • viewPath → path in config
  • viewName → name in each target
  • viewId → id in each target
  • viewLevel → level in each target
  • viewType stays as viewType (unchanged)
  • async removed only from routing.config (implicit true in v2). Do NOT touch async on models, dataSources, or other unrelated config — see Section 6 scope warning.
  • type: "View" added to config (alternatively, add "type": "View" to each individual target if mixing views and components)

When to add type to config vs per target:

  • type in config (most common): All targets are views
  • type per target: Mixed routing targets (some views, some components)

Implementation Steps

  1. Read and parse the manifest.json file
  2. For each linter error (identified by rule ID and message):
    • no-outdated-manifest-version: Update root _version to "2.0.0" (keep nested _version values unchanged)
    • no-legacy-ui5-version-in-manifest: Update minUI5Version to "1.136.0"
    • no-deprecated-library: Remove the library from dependencies
    • no-deprecated-component: Remove the component from dependencies
    • no-deprecated-api (view type): Change to "XML"
    • no-deprecated-api (resources/js): Remove if empty
    • no-removed-manifest-property: Remove the property
  3. If _version was updated to 2.0.0, also apply routing modernization:
    • Rename viewPath → path, viewName → name, viewId → id, viewLevel → level in routing config and targets
    • Add type: "View" to routing.config (or per target)
    • Remove async only from sap.ui5/rootView and sap.ui5/routing/config. Do NOT remove async from model settings, dataSources, or any other path — those keep their async flag.
  4. Preserve JSON formatting (indentation)
  5. Write the updated file

Example Fix

Given linter output:

manifest.json:2:3 error manifest.json must be modernized to Version 2  no-outdated-manifest-versionmanifest.json:15:5 error Use UI5 version 1.136.0 or higher in manifest.json  no-legacy-ui5-version-in-manifestmanifest.json:20:7 error Use of deprecated library 'sap.ui.commons'  no-deprecated-librarymanifest.json:35:9 error Property '/sap.ui5/rootView/async' has been removed in Manifest Version 2  no-removed-manifest-propertymanifest.json:40:9 error Property '/sap.ui5/routing/config/async' has been removed in Manifest Version 2  no-removed-manifest-property

Transform:

json
// Before{  "_version": "1.12.0",  "sap.app": {    "_version": "1.1.0",    ...  },  "sap.ui5": {    "_version": "1.2.0",    "dependencies": {      "minUI5Version": "1.84.0",      "libs": {        "sap.m": {},        "sap.ui.commons": {},        "sap.ui.layout": {}      }    },    "rootView": {      "viewName": "my.app.view.Main",      "type": "XML",      "async": true    },    "routing": {      "config": {        "routerClass": "sap.m.routing.Router",        "viewType": "XML",        "viewPath": "my.app.view",        "controlId": "app",        "controlAggregation": "pages",        "async": true      },      "routes": [        { "name": "main", "pattern": "", "target": "main" }      ],      "targets": {        "main": {          "viewName": "Main",          "viewId": "main",          "viewLevel": 1        }      }    }  }}
// After{  "_version": "2.0.0",  "sap.app": {    "_version": "1.1.0",    ...  },  "sap.ui5": {    "_version": "1.2.0",    "dependencies": {      "minUI5Version": "1.136.0",      "libs": {        "sap.m": {},        "sap.ui.layout": {}      }    },    "rootView": {      "viewName": "my.app.view.Main",      "type": "XML"    },    "routing": {      "config": {        "routerClass": "sap.m.routing.Router",        "viewType": "XML",        "path": "my.app.view",        "controlId": "app",        "controlAggregation": "pages",        "type": "View"      },      "routes": [        { "name": "main", "pattern": "", "target": "main" }      ],      "targets": {        "main": {          "name": "Main",          "id": "main",          "level": 1        }      }    }  }}

Notes

  • Only update the root _version to 2.0.0 — do NOT change nested _version properties inside sap.app, sap.ui, sap.ui5, etc.
  • When updating _version to 2.0.0, always apply routing property renames and add type: "View" in the same pass
  • Changing view types from JSON/HTML/JS to XML requires the actual view files to be converted - flag this as a follow-up task
  • When removing deprecated libraries, check if there are any imports from those libraries in the codebase that need modernization
  • The minUI5Version update means the app won't run on older UI5 versions - this is intentional for modern UI5 compatibility
  • After updating _version to 2.0.0, synchronizationMode and other v1-specific properties should also be removed if present
  • Manifest v2 strictness: Manifest v2.0.0 enables stricter error handling — syntactical errors in views/fragments now throw errors instead of failing silently
  • sap.ui/supportedThemes causes an error in manifest v2 — remove it if present
  • IAsyncContentCreation is NOT enforced by manifest v2 — it must be explicitly added in Component.js by the fix-component-async skill (this skill does not handle it)
  • Typed View alternative: When changing deprecated view types (JS, JSON, HTML) the default replacement is XML, but for complex JS-heavy views, consider Typed views as an alternative

Related Skills

  • fix-component-async: After updating manifest.json, Component.js needs the IAsyncContentCreation interface — defer to that skill for correct placement
  • fix-bootstrap-params: For deprecated libraries referenced in HTML bootstrap (data-sap-ui-libs), use fix-bootstrap-params instead of this skill

來源與署名

來源:UI5/plugins-coding-agents位於plugins/ui5-modernization/skills/fix-manifest-json提交2b8c4a9

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架