Manifest best practices: Detect `serviceUrl` or `uri` under `/sap.ui5/models` and migrate to `/sap.app/dataSources`
Maintainers usually reply within 1 day
@flovogt is already working on this.
Since Oct 1, 2026.
Assessment
This issue has not been assessed yet.
Description
Is your feature request related to a problem? Please describe.
For ODataModels, the data-source URL should be defined in a /sap.app/dataSources entry only, so that the URL can be correctly enriched (Currently by sap/ui/core/Component) with:
sap-context-token=...sap-client=...sap-language=...sap-system=...- ...
Especially if a $metadata request includes the URL parameter sap-context-token but misses sap-client (scenario "A"), the app can break if the OData service/backend is strict about it therefore responds with 400 Bad Request.
According to Issues with OData Metadata Caching | SAP Help Portal:
Prerequisites for OData Metadata Caching
...
SAPUI5 Best Practices
The app itself needs to fulfill certain prerequisites. App developers need to make sure of the following criteria:
- ...
- The app must declare the OData services under
sap.app/datasources.- The app must declare the SAPUI5 models under
sap.ui5/modelsso that they are created.
- The model must refer to the data source. It must not specify the URL directly (under
sap.ui5/models).- ...
- ...
Scenarios that result in either bypassing the data-source URL enrichment or breaking the app entirely:
| Scenario | Where | Manifest / code | Recommended severity |
|---|---|---|---|
| A | manifest | /sap.app/dataSources has the data-source, and the model under /sap.ui5/models references it correctly, but also unexpectedly sets serviceUrl or uri with the same source URL, violating the "must not specify the URL directly"-rule under /sap.ui5/models (Redeclared source wins --> sends $metadata?sap-context-token=... without sap-client --> 400 Bad Request depending on backend) |
Error |
| B | manifest | /sap.app/dataSources has the data-source, but the model misses referencing it via dataSource, uses serviceUrl / uri with the same source URL. |
Warning |
| C | manifest | /sap.app/dataSources doesn't include the data-source at all. The model's serviceUrl/uri is the only service definition. |
Warning |
| D | JS | An ODataModel is created imperatively instead of declaratively in the manifest - sometimes even re-created several times for the same service (often found in legacy apps) |
Warning |
Besides the possible use of sap-context-token for client-side $metadata and annotation caching, maintaining and using /sap.app/dataSources (instead of serviceUrl under /sap.ui5/models) allows also:
- Key-user/Developer adaptation features such as changing the
dataSourcescontent (See e.g.sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.jswhich needs/sap.app/dataSourcesentries to work) - SAP Fiori tools features such as the Data Editor and annotation management to locate and work with the appropriate metadata via
/sap.app/dataSources.
Describe the solution you'd like
A rule that detects a service URL defined outside a /sap.app/dataSources-entry and encourages migration to dataSources.
E.g. for A-C scenarios:
{
"sap.app": {
+ "dataSources": {
+ "myMainService": {
+ "uri": "/sap/opu/odata4/myservice/",
+ "type": "OData",
+ "settings": {
+ "odataVersion": "4.0",
...
"sap.ui5": {
"models": {
"": {
+ "dataSource": "myMainService" // "type" / "uri" / "settings" derived from the data source. URL gets enriched.
- "type": "sap.ui.model.odata.v4.ODataModel",
"settings": {
- "serviceUrl": "/sap/opu/odata4/myservice/",
...
Optionally, local JSONModel/XMLModel could be migrated to dataSources too but I don't see a real benefit other than keeping more data sources consistently in /sap.app/dataSources.
- Dominant language
- TypeScript
- Stars
- 82
- Forks
- 14
- Avg merge
- 10h 17m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UI5/linter
-
Feat: Maximize performance for XML/HTML parsingPossibly taken @flovogt claimed this 17 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
UI5/linter#1164 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Sync UI5 versions across projectMay be free again @flovogt claimed this 53 days ago, and no pull request is open. Opendetection
UI5/linter#1155 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and possibly autofix missing super calls when overriding UI5 lifecycle and event hooksMay be free again @flovogt claimed this 67 days ago, and no pull request is open. Opendetection
Difficulty 4/5 3-5 days Newbie friendliness 45/100
UI5/linter#1140 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and fix missing library dependencies in UI5 YAMLMay be free again @flovogt claimed this 68 days ago, and no pull request is open. Openautofix detection
UI5/linter#1139 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and fix direct imports of sap/m/URLHelperMay be free again @flovogt claimed this 68 days ago, and no pull request is open. Openautofix detection
UI5/linter#1138 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
can1357/oh-my-pi#21349 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ohcnetwork/care_fe#17474 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100