-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Problem
When a multitenant CAP application enables extensibility (cds.requires.extensibility) or feature toggles (cds.requires.toggles), tenants can customize their CDS model via cds push — adding entities, fields, and services. Per the ORD specification, these system-instance-aware differences MUST be reflected in the ORD document.
Currently, @cap-js/ord always generates ORD from the global base model, ignoring all tenant-specific model changes.
Affected tenant scenarios
| Tenant action | Expected ORD behavior | Current |
|---|---|---|
extend Orders with { x_field: String } |
OpenAPI/EDMX includes new field | ❌ base model only |
Add new entity x_SalesRegion |
New entityType in ORD | ❌ |
extend service with { entity x_Foo } |
New API resource in ORD | ❌ |
| Feature toggle enables/disables a service | Service appears/disappears in ORD | ❌ |
Note: for pure multitenancy without extensibility/toggles, the base ORD document is correctly shared across all tenants — no change needed.
Root cause
ORD endpoints bypass the CDS middleware stack (auth → ctx-model), so tenant-specific CSN is never resolved. Other CDS plugins (e.g. @cap-js/graphql) correctly integrate with cds.middlewares, giving them automatic tenant awareness.