Skip to content

Conversation

@yoeunes
Copy link
Contributor

@yoeunes yoeunes commented Nov 13, 2025

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:

CleanShot 2025-11-13 at 17 30 50

@carsonbot carsonbot added this to the 7.4 milestone Nov 13, 2025
@yoeunes yoeunes force-pushed the fix-routing-schema-validation branch 2 times, most recently from 8a0c7f0 to 5870a2b Compare November 13, 2025 16:25
@stof
Copy link
Member

stof commented Nov 13, 2025

2. Allows all other import keys (prefix, type, namespace, etc.) to be nested inside the resource object, matching the merging behavior of YamlFileLoader.

Where do you see such merging behavior ?

@stof
Copy link
Member

stof commented Nov 13, 2025

Technically, resource could actually be almost anything (except null) as long as you have a loader supporting it.

@yoeunes yoeunes force-pushed the fix-routing-schema-validation branch from 5870a2b to 88d56db Compare November 13, 2025 16:56
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 13, 2025

Technically, resource could actually be almost anything (except null) as long as you have a loader supporting it.

that's right, although I'd describe what is the most common. The schema is not enforced so ppl that use exotic resource could either report an issue explaining their case - or ignore the failure (and if nobody gets back, then that's fine as that'd mean the schema is providing best guidance).

@yoeunes yoeunes force-pushed the fix-routing-schema-validation branch from 88d56db to bc3ddef Compare November 13, 2025 17:01
@yoeunes yoeunes force-pushed the fix-routing-schema-validation branch from bc3ddef to e110f99 Compare November 13, 2025 17:04
@yoeunes
Copy link
Contributor Author

yoeunes commented Nov 13, 2025

Hi @stof and @nicolas-grekas, thank you for the feedback and clarification 🙏🏼.

@stof, you were right, my initial assumption about a full merge behavior was incorrect.

I've also included the deprecated key for routes (to match the XSD)

@nicolas-grekas
Copy link
Member

Thank you @yoeunes.

@nicolas-grekas nicolas-grekas merged commit 68c6f2d into symfony:7.4 Nov 13, 2025
11 of 12 checks passed
This was referenced Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible config array-shape issues

4 participants