8000 [Routing] make path required again in the xsd · symfony/symfony@f939fea · GitHub
[go: up one dir, main page]

Skip to content

Commit f939fea

Browse files
committed
[Routing] make path required again in the xsd
pattern was previously also required, see 5082994#diff-4
1 parent 82d54fa commit f939fea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Routing/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function supports($resource, $type = null)
113113
*/
114114
protected function parseRoute(RouteCollection $collection, \DOMElement $node, $path)
115115
{
116-
if ('' === ($id = $node->getAttribute('id')) || (!$node->hasAttribute('pattern') && !$node->hasAttribute('path'))) {
116+
if ('' === ($id = $node->getAttribute('id')) || !$node->hasAttribute('path')) {
117117
throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" must have an "id" and a "path" attribute.', $path));
118118
}
119119

src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
3838

3939
<xsd:attribute name="id" type="xsd:string" use="required" />
40-
<xsd:attribute name="path" type="xsd:string" />
40+
<xsd:attribute name="path" type="xsd:string" use="required" />
4141
<xsd:attribute name="host" type="xsd:string" />
4242
<xsd:attribute name="schemes" type="xsd:string" />
4343
<xsd:attribute name="methods" type="xsd:string" />

0 commit comments

Comments
 (0)
0