Commit 68c6f2d
committed
bug #62389 [Routing] Align routing.schema.json with YamlFileLoader behavior (yoeunes)
This PR was merged into the 7.4 branch.
Discussion
----------
[Routing] Align routing.schema.json with YamlFileLoader behavior
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fixes #62387
| License | MIT
This fix implements two changes to align the schema with the `YamlFileLoader`'s behavior and the official XSD:
1. **Fixes `resource` key:** Allows `resource` in an import to be either a `string` (for file paths) or a strict `{ path, namespace }` object (for PSR-4 imports), setting `additionalProperties: false`.
2. **Adds `deprecated` key:** Adds the `deprecated` property to `routeDefinition` to be consistent with `routeAlias` and the official XSD.
This resolves schema validation errors in IDEs for standard import patterns:
<img width="816" height="431" alt="CleanShot 2025-11-13 at 17 30 50" src="https://github.com/user-attachments/assets/13056058-367f-4029-8704-1d8ac3a5b949" />
Commits
-------
e110f99 [Routing] Align routing.schema.json with YamlFileLoader behaviorFile tree
1 file changed
+28
-3
lines changed- src/Symfony/Component/Routing/Loader/schema
1 file changed
+28
-3
lines changedLines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
73 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
74 | 99 | | |
75 | 100 | | |
76 | 101 | | |
77 | 102 | | |
78 | 103 | | |
79 | 104 | | |
80 | 105 | | |
81 | | - | |
| 106 | + | |
82 | 107 | | |
83 | 108 | | |
84 | 109 | | |
| |||
0 commit comments