This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,17 @@ support them. Create `create<type>(array $metadata)` methods for each
126
126
type you wish to support, where ` <type> ` is your custom class name, minus
127
127
the namespace.
128
128
129
+ > ### Limitation
130
+ >
131
+ > There is a [ known limitation] ( https://github.com/zendframework/zend-expressive-hal/issues/5 )
132
+ > with zend-router when using routes with optional parameters (e.g., ` /books[/:id] ` ,
133
+ > where ` :id ` is optional). In such cases, if no matching parameter is provided
134
+ > (such as when generating a URI without an ` :id ` ), the router will raise an
135
+ > exception due to the missing parameter.
136
+ >
137
+ > If you encounter this issue, create separate routing entries for each optional
138
+ > parameter. See the issue for a comprehensive example.
139
+
129
140
## Zend\Expressive\Hal\ResourceGeneratorFactory
130
141
131
142
- Registered as service: ` Zend\Expressive\Hal\ResourceGenerator `
Original file line number Diff line number Diff line change @@ -142,6 +142,17 @@ $link = $linkGenerator->templatedFromRoute(
142
142
If you need to generate custom links based on routing, we recommend composing
143
143
the ` LinkGenerator ` in your own classes to do so.
144
144
145
+ > ### Limitation
146
+ >
147
+ > There is a [ known limitation] ( https://github.com/zendframework/zend-expressive-hal/issues/5 )
148
+ > with zend-router when using routes with optional parameters (e.g., ` /books[/:id] ` ,
149
+ > where ` :id ` is optional). In such cases, if no matching parameter is provided
150
+ > (such as when generating a URI without an ` :id ` ), the router will raise an
151
+ > exception due to the missing parameter.
152
+ >
153
+ > If you encounter this issue, create separate routing entries for each optional
154
+ > parameter. See the issue for a comprehensive example.
155
+
145
156
## Resources
146
157
147
158
A HAL resource is simply the representation you want to return for your API.
You can’t perform that action at this time.
0 commit comments