Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 95b67bd

Browse files
committed
Merge branch 'hotfix/29'
Close #29
2 parents c42a0c4 + 98b8cb5 commit 95b67bd

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/book/factories.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ support them. Create `create<type>(array $metadata)` methods for each
126126
type you wish to support, where `<type>` is your custom class name, minus
127127
the namespace.
128128

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+
129140
## Zend\Expressive\Hal\ResourceGeneratorFactory
130141

131142
- Registered as service: `Zend\Expressive\Hal\ResourceGenerator`

docs/book/links-and-resources.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,17 @@ $link = $linkGenerator->templatedFromRoute(
142142
If you need to generate custom links based on routing, we recommend composing
143143
the `LinkGenerator` in your own classes to do so.
144144

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+
145156
## Resources
146157

147158
A HAL resource is simply the representation you want to return for your API.

0 commit comments

Comments
 (0)