Mapping paths should allow arbitrary files
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing the mapping()->paths() configuration and how the supplied paths are discovered for API resources. Use the Finder example to compare directory and individual-file inputs, then verify that only the requested files are searched and that the container cache is unaffected by unrelated test changes.
Written by the indexing model from the issue text.
Description
Description
The mapping paths configuration currently only supports directories. This means that it must search all files within the directory for api resources. However, when tests are located next to code (as is done in other languages), this means that tests are also searched for resources. This slows down the container building as there are more files to be searched, as well as invalidates cache whenever a test changes.
It would be great to be able to specify the individual files to be checked instead of the directories that contain them.
Example
$paths = Finder::create()
->in(__DIR__ . '/../src')
->notName('/.*Test.php/')
->files();
$apiPlatform
->mapping()
->paths(array_map(fn ($path) => $path->getRealPath(), iterator_to_array($paths)));
- Dominant language
- PHP
- Stars
- 2.6k
- Forks
- 989
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 100
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from api-platform/core
-
JSON:API: resource schemas (`*.jsonapi`) have `properties` but no `type: object`Possibly taken @ousamabenyounes claimed this 2 days ago. Open
Difficulty 2/5 Under an hour Newbie friendliness 80/100
api-platform/core#8701 ·
Maintainers usually reply within 1 day
-
JSON:API: `JsonApiCollectionBaseSchemaNoPagination` declares `data` as `type: array` without `items`Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api-platform/core#8699 ·
Maintainers usually reply within 1 day
-
[Json-Schema] Nested resources lost externalDoc and description dataPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
api-platform/core#8721 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
api-platform/core#8704 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
api-platform/core#8703 ·
Maintainers usually reply within 1 day
All issues in api-platform/core
Similar issues
-
domain/discovery
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
neos/flow-development-collection#3639 · 1 comment ·
Maintainers usually reply within 1 day
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3Possibly taken @ekamran claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WordPress/phpunit-test-runner#359 ·
Maintainers usually reply within 2 days
-
[ObjectMapper] Merge the objects that repeated `#[Map]` attributes map …Possibly taken A pull request linked to this issue is open or already merged. OpenObjectMapper
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
symfony/symfony-docs#23390 ·
Maintainers usually reply within 2 days