Closed shimono closed 3 years ago
Add requirements from CEPS 2.0 Draft.
What about the following for new syntax.
<p:route path="{express syntax}" script="entity.js" />
I googled some example of URI templating. I realized that there are mainly two pattern, RFC 6570 style and express-style.
https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates using URI Templating defined in RFC 6570. (maybe, using JAX-RS internally)
RouterFunction<ServerResponse> route = route()
.GET("/person/{id}", accept(APPLICATION_JSON), handler::getPerson)
.GET("/person", accept(APPLICATION_JSON), handler::listPeople)
.POST("/person", handler::createPerson)
.build();
https://guides.rubyonrails.org/routing.html
I cannot find any documentation containing details of templating. (please tell me if you know)
get 'photos/:id/with_user/:user_id', to: 'photos#show'
https://expressjs.com/ja/guide/routing.html
internally using path-to-regexp package https://github.com/pillarjs/path-to-regexp/tree/v1.7.0
app.get('/users/:userId/books/:bookId', function (req, res) {
res.send(req.params)
})
https://router.vuejs.org/ja/guide/essentials/dynamic-matching.html using express-style path expression (path-to-regexp)
https://reactrouter.com/web/api/Route/path-string-string using express-style path expression (path-to-regexp)
https://laravel.com/docs/8.x/routing
example
public function boot()
{
Route::pattern('id', '[0-9]+');
parent::boot();
}
Route::get('user/{id}/profile', function ($id) {
//
})->name('profile');
$url = route('profile', ['id' => 1]);
example
[Route("users/{id:int:min(1)}")]
Overview
Make Engine Service Collection path configuration accept RegEx instead of fixed path string. This makes more flexible engine service endpoint possible.
Problem to solve.
One of the typical use cases of engine service is to create a restricted view to an odata entity set. However you can't create an odata-compatible endpoint out of engine since a custom endpoint created by an engine service only serves at a fixed url.
Solution
Extending current Engine Service Collection configuration syntax a bit and accept RegEx or some simple pattern like the followings.
current
extended