High level api for route parameters.
See original GitHub issueAdd support for multiple route parameters deserialisation.
It can be similar to HasUrlParameter
which supports deserialisation of one route parameter.
Make use of the route parameters api implemented in https://github.com/vaadin/flow/pull/7608.
Related to https://github.com/vaadin/flow/issues/2740 and https://github.com/vaadin/flow/issues/4213
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Step 3: Parameters (API reference tutorial) | Documenting APIs
In this example, the parameters are grouped by type: path parameters, query parameters, and body parameters. The endpoint also sets off the path ......
Read more >Routes API migration guide - Google Developers
This guide describes how to migrate your existing apps that use the Directions API and Distance Matrix API to use the new Routes...
Read more >Common Routing Parameters | Routing API and Extended ...
The Common Routing Parameters section describes common parameters that affect the routing algorithm in various ways. The Consumption Model ...
Read more >Attribute Routing in ASP.NET Web API 2 | Microsoft Learn
Web API 2 supports a new type of routing, called attribute routing. As the name implies, attribute routing uses attributes to define routes....
Read more >8.4: RESTful Routes with Parameters - Programming with Text
In "Building an API in Node" video for the ITP course "Programming from A to Z", I expand on the previous video ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My hypothesis is that at least 80% of all cases will need only one parameter. Out of the remaining 20%, another 80% will need only two parameters and so on.
The 80% case with only one parameter is already nicely served by the current
HasUrlParameter<T>
API. My main question is whether any design for he remaining 20% would bring so much improvements to application cod that it would be worth the investment from our side compared to some other DX improvements that we could do that would target some more common use case.Other cases can with relatively little boilerplate do something like this:
Introducing a DTO for those two parameters would require the additional overhead of actually defining that DTO class. That DTO could then be used in combination with the current one-parameter approach as
HasUrlParameter<DtoType>
. The actual routing code could then be simplified to this:The reduction in the needed code is quite minimal, but a secondary benefit is that type conversions and magic strings are moved out of sight. Another benefit is the possibility of creating a
RouterLink
based on an instance ofdto
(which would work without additional API additions if done based onHasUrlParameter<DtoType>
).Actually, in our routing context there should be no need for handling these exceptions if the route is defined correctly. If the regex assigned to the route parameter doesn’t match the value of the parameter in the url, then the navigation fails before reaching conversion phase.