-
Notifications
You must be signed in to change notification settings - Fork 27
Service Locator Enhancement #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x
Are you sure you want to change the base?
Conversation
@mgerzabek could you rebase on 5.x, I fixed the issue with the tests. Thanks! |
14256bc
to
012d259
Compare
@27pchrisl, I've rebased on 5.x and removed the |
I've opened doctrine/dbal#7050 which should resolve the issue with the tests. @mgerzabek |
a3bfa45
to
d97aa23
Compare
- added missing type PropertyPath - added Identifier to Record - added missing Type attribute to Record - added alias to Identifier – including dirty hack to derive it from given namespace - added addReference to Lodata Facade to allow adding additional vocabularies to the model - added alias for all auto registered References
This is important to allow Token Handling for Clients like OpenUi5
When multiple Endpoints are declared, and the frontend requests the global Endpoint (with only one path segment), accessing $segments[1] caused an 'Undefined array key' warning. This commit adds a count($segments) check to avoid invalid index access and preserve compatibility with global Endpoint logic.
…t routing docs - Introduced new method serviceUri(): string to explicitly declare the logical URI segment for each OData endpoint - Updated ServiceEndpointInterface PHPDoc to reflect modular, config-driven routing - Clarified semantics of endpoint() and route() to match actual behavior in Endpoint base class - Aligns terminology with ServiceProvider::boot() logic for endpoint resolution
- remove "extra.laravel" from composer.json to disable auto-registration - always boot default Endpoint in ServiceProvider for consistent behavior - drop request path inspection logic for segmented endpoint resolution ==> apps requiring multiple OData endpoints should now implement and register their own ServiceProvider (see docs for example)
- added missing type PropertyPath - added Identifier to Record - added missing Type attribute to Record - added alias to Identifier – including dirty hack to derive it from given namespace - added addReference to Lodata Facade to allow adding additional vocabularies to the model - added alias for all auto registered References
When multiple Endpoints are declared, and the frontend requests the global Endpoint (with only one path segment), accessing $segments[1] caused an 'Undefined array key' warning. This commit adds a count($segments) check to avoid invalid index access and preserve compatibility with global Endpoint logic.
…t routing docs - Introduced new method serviceUri(): string to explicitly declare the logical URI segment for each OData endpoint - Updated ServiceEndpointInterface PHPDoc to reflect modular, config-driven routing - Clarified semantics of endpoint() and route() to match actual behavior in Endpoint base class - Aligns terminology with ServiceProvider::boot() logic for endpoint resolution
- remove "extra.laravel" from composer.json to disable auto-registration - always boot default Endpoint in ServiceProvider for consistent behavior - drop request path inspection logic for segmented endpoint resolution ==> apps requiring multiple OData endpoints should now implement and register their own ServiceProvider (see docs for example)
Resolve compatibility issue with `NavigationProperty::generatePropertyValue` after the introduction of targeted entity ID handling in upstream PR flat3#858. Restores support for local extensions without breaking the new `$requestedTarget` logic.
f477c61
to
fdb8806
Compare
@27pchrisl — Sorry for the noise, but I just realized that the PR merged yesterday introduced new incompatibilities with mine. Those should be resolved now. However, for some reason, MongoDB is once again causing CI trouble — likely unrelated to this PR. As announced, this version no longer uses Composer The documentation has been updated accordingly, including a new example of a multi-endpoint-capable service provider for those who need modular setups. Let me know if anything else needs adjustment — thanks! |
Add Support for Modular OData Service Endpoints
This PR introduces a powerful mechanism for defining modular, multi-endpoint OData services in Laravel when using
flat3/lodata
. It enables a clean and scalable way to expose different domains or bounded contexts under separate OData endpoints, each with their own$metadata
and query surface..idea
(personal) project files not all ignored #742Key Features
config/lodata.php
)/odata/{key}/...
)$metadata
discover()
method for dynamic schema registrationcachedMetadataXMLPath()
discover()
is only invoked on-demandImplementation Overview
config('lodata.endpoints')
)$endpoint->cachedMetadataXMLPath()
) to support arbitrary annotationsDocumentation
For a detailed overview of the architecture, configuration, and usage of modular service endpoints, please refer to the comprehensive documentation accompanying this pull request.
Benefits
Notes
This PR does not introduce breaking changes. Existing single-endpoint behavior remains the default. If
config('lodata.endpoints')
is empty, the global service continues to be served as before.Let me know if you'd like this split into smaller commits or if you'd prefer to review feature-by-feature. Thanks for the great base package! 🙌