Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat Ability to configure resource_class_directories #1665

Merged
merged 1 commit into from
Jan 29, 2018

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Jan 25, 2018

Q A
Bug fix? yes
New feature? yes/no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1655
License MIT
Doc PR need to do

It's better for flex.

@dunglas
Copy link
Member

dunglas commented Jan 25, 2018

What's the difference with mappings?

@dunglas
Copy link
Member

dunglas commented Jan 25, 2018

To be more explicit: shouldn't we set the default value of this parameter with the paths defined in mappings?

@soyuka
Copy link
Member Author

soyuka commented Jan 25, 2018

To be more explicit: shouldn't we set the default value of this parameter with the paths defined in mappings?

Okay so at first I added $paths['dir'] = dirname($yamlPath) in

} elseif ($container->fileExists($path, false)) {

But in fact those are really different to me because if I add src/App to the directories it's not src/App/Entity and it'll not really parse the correct directory.

To be more explicit: shouldn't we set the default value of this parameter with the paths defined in mappings?

We're doing this but we don't know if the directory contains entities or not.

I also tried to do the mapping with src/App where it contains:

src/App/services.yaml
src/App/resources.yaml
src/App/Entities

This kinda works but you'll get a resource "services" not found cause it tries to parse services.yaml as a resource file.

Also we rely on bundlesPath here:

foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) {

And there are no more bundles for my resources.

@soyuka soyuka force-pushed the fix_resource_class_directories branch from f229631 to 721da25 Compare January 25, 2018 10:20
@soyuka soyuka force-pushed the fix_resource_class_directories branch from 721da25 to 00c65cf Compare January 25, 2018 11:16
@soyuka soyuka merged commit 579b73f into api-platform:2.1 Jan 29, 2018
@soyuka soyuka deleted the fix_resource_class_directories branch January 29, 2018 09:44
soyuka pushed a commit to soyuka/doc that referenced this pull request Jan 29, 2018
dunglas added a commit to api-platform/docs that referenced this pull request Jan 29, 2018
hoangnd25 pushed a commit to hoangnd25/core that referenced this pull request Feb 23, 2018
…irectories

feat Ability to configure resource_class_directories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants