Skip to content

Issues with cds-feature-ord when consumed by UCL #27

Description

@melwinlobo21

We are a CAP Java project using cds-feature-ord to enable ORD. UCL crawls our ORD endpoints as part of its discovery flow, and we encountered the following issues during integration.


Issue 1: perspective field missing from well-known endpoint response

The /.well-known/open-resource-discovery response does not include the perspective field, even when configured in .cdsrc.json.

Actual:

{
  "openResourceDiscoveryV1": {
    "documents": [{
      "url": "/ord/v1/documents/ord-document",
      "accessStrategies": [{ "type": "open" }]
    }]
  }
}

Looking at WellKnownServlet.createOrdDocument(), the OrdDocument model has no getPerspective() and the map passed to OrdDocument.of() never includes perspective, so the config value is silently ignored.

UCL requires perspective to be present — its absence causes discovery to fail.


Issue 2: Empty Local-Tenant-Id header triggers Dynamic provider instead of Static

When UCL crawls /ord/v1/documents/ord-document, it sends Local-Tenant-Id: (empty string). DocumentsServlet passes this directly to systemUser(request.getHeader("Local-Tenant-Id")), which receives "" instead of null.

useStaticModel() evaluates correctly — tenant is null — but systemUser("") does not behave the same as systemUser(null), causing the Dynamic provider to invoke the MTX sidecar instead of serving static resources, which fails in this context.


Issue 3: perspective should be dynamic based on whether Static or Dynamic provider serves the request

We use @cap-js/ord in the MTX sidecar to serve dynamic ORD for tenant-extended models. The sidecar sets perspective: system-instance, which is correct for dynamic ORD. However, the static provider should return perspective: system-version.

Since cds-feature-ord does not include perspective in the well-known response at all (Issue 1), we worked around it with a custom controller that hardcodes perspective: system-version. This breaks the dynamic case — when UCL sends a request that routes to the sidecar, the well-known endpoint still advertises system-version, which is incorrect.

Ideally, perspective in the well-known response should reflect whether the request will be served statically (system-version) or dynamically (system-instance), or the library should expose a way to configure this per-request.


Version: cds-feature-ord 4.9.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions