You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: normalize relative paths and enforce ServiceUrl as constant
Two improvements for Studio Pro compatibility:
1. **Normalize relative paths to absolute file:// URLs**
- Relative paths (./path or path/file.xml) are automatically converted
to absolute file:// URLs in the Mendix model
- Ensures Studio Pro can detect local file vs HTTP metadata sources
- Example: './metadata.xml' → 'file:///absolute/path/to/project/metadata.xml'
2. **Enforce ServiceUrl as constant reference**
- ServiceUrl must always start with '@' (e.g., '@Module.ConstantName')
- Direct URLs are rejected with clear error message
- Enforces Mendix best practice of externalizing configuration
Implementation:
- Added normalizeMetadataUrl() function with path resolution logic
- Added validation in createODataClient() for ServiceUrl format
- Updated all documentation and examples
- Added comprehensive test coverage
- Added test MPK file with real Studio Pro-created services
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: mdl-examples/odata-local-metadata/README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,11 @@ This example demonstrates how to create consumed OData services using local meta
9
9
-**Version-pinned metadata** — lock to a specific metadata version
10
10
-**Pre-production services** — test against metadata files before deployment
11
11
12
+
## Important Notes
13
+
14
+
1.**Relative paths are normalized** — Any relative path is automatically converted to an absolute `file://` URL in the Mendix model for Studio Pro compatibility
15
+
2.**ServiceUrl must be a constant** — Always use `@Module.ConstantName` format, not direct URLs
0 commit comments