Class LaravelUi5\Sdk\Http\Middleware\BindSdkContextForOData

final
readonly

Bridges Core's OData middleware chain to SDK's SdkUi5ContextFactory.

Core's ResolveUi5Context middleware (on the ui5/ prefix) invokes Ui5ContextFactoryInterface::build(), which — under SDK — binds SdkContext into the container. The OData chain (odata/ prefix) has no equivalent step, so OData requests reach ScopedAbstractEntitySet with no SdkContext bound; RoleScopeApplier::resolveActorId() then catches BindingResolutionException, returns null, and the scope falls through to 1 = 0 — every scoped OData query returns empty.

This middleware closes that gap by invoking the same factory the UI5 prefix uses. SdkUi5ContextFactory does the actual binding as a side effect of build().

Place AFTER ResolveODataEndpoint (which binds ODataServiceInterface) and AFTER EnsureODataAuthenticated (factory throws on no auth).

Methods