Skip to content

Commit 5870a2b

Browse files
committed
[Routing] Align routing.schema.json with YamlFileLoader behavior
1 parent 1fdfd24 commit 5870a2b

File tree

1 file changed

+71
-2
lines changed

1 file changed

+71
-2
lines changed

src/Symfony/Component/Routing/Loader/schema/routing.schema.json

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,84 @@
6262
"locale": { "type": "string" },
6363
"format": { "type": "string" },
6464
"utf8": { "type": "boolean" },
65-
"stateless": { "type": "boolean" }
65+
"stateless": { "type": "boolean" },
66+
"deprecated": {
67+
"type": "object",
68+
"properties": {
69+
"package": { "type": "string" },
70+
"version": { "type": "string" },
71+
"message": { "type": "string" }
72+
},
73+
"required": ["package", "version"],
74+
"additionalProperties": false
75+
}
6676
},
6777
"required": ["path"],
6878
"additionalProperties": false
6979
},
7080
"routeImport": {
7181
"type": "object",
7282
"properties": {
73-
"resource": { "type": "string", "description": "Path to the resource to import." },
83+
"resource": {
84+
"description": "Path to the resource to import, or an object containing 'path' and other import properties (which are merged with sibling properties).",
85+
"oneOf": [
86+
{ "type": "string" },
87+
{
88+
"type": "object",
89+
"properties": {
90+
"path": { "type": "string" },
91+
"type": {
92+
"type": "string",
93+
"description": "The type of the resource (e.g., 'attribute', 'yaml')."
94+
},
95+
"prefix": {
96+
"oneOf": [
97+
{ "type": "string" },
98+
{ "type": "object", "patternProperties": { "^.+$": { "type": "string" } } }
99+
],
100+
"description": "A URL prefix to apply to all routes from the imported resource."
101+
},
102+
"name_prefix": {
103+
"type": "string",
104+
"description": "A name prefix to apply to all routes from the imported resource."
105+
},
106+
"namespace": {
107+
"oneOf": [
108+
{ "type": "string" },
109+
{ "type": "object", "patternProperties": { "^.+$": { "type": "string" } }, "additionalProperties": false }
110+
],
111+
"description": "The namespace of the controllers in the imported resource (e.g., 'App\\Controller\\Portal'). Can be a map for localized namespaces."
112+
},
113+
"requirements": { "type": "object", "additionalProperties": { "type": "string" } },
114+
"defaults": { "type": "object" },
115+
"options": { "type": "object" },
116+
"host": {
117+
"oneOf": [
118+
{ "type": "string" },
119+
{ "type": "object", "patternProperties": { "^.+$": { "type": "string" } }, "additionalProperties": false }
120+
]
121+
},
122+
"schemes": {
123+
"oneOf": [
124+
{ "type": "string" },
125+
{ "type": "array", "items": { "type": "string" } }
126+
]
127+
},
128+
"condition": { "type": "string" },
129+
"trailing_slash_on_root": { "type": "boolean" },
130+
"methods": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] },
131+
"locale": { "type": "string" },
132+
"format": { "type": "string" },
133+
"utf8": { "type": "boolean" },
134+
"exclude": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] },
135+
"stateless": { "type": "boolean" },
136+
"controller": { "type": "string" }
137+
},
138+
"required": ["path"],
139+
"additionalProperties": false
140+
}
141+
]
142+
},
74143
"type": {
75144
"type": "string",
76145
"description": "The type of the resource (e.g., 'attribute', 'annotation', 'yaml')."

0 commit comments

Comments
 (0)