Skip to content

BC break from 4.1.2 if you have badly named entity? #7067

@wtfred

Description

@wtfred

API Platform version(s) affected: 4.1.2 and more

Description
I upgraded this morning from api-platform/core 4.0.16 to api-platform/core 4.1.6, and i got 2 routes "disappeared"
Routes where from 2 differents entities, Test.php and OneOffTest.php
I found the commit causing this was this one ba57714#diff-0d56a84d21cd4b276d12f866fb873f975a4ceb373ad27b902802f23c8f32fb76 introduced in api-platform/core v4.1.2

So yeah, i know my naming is not the best, but after all, it is for an API managing tests from students.

Is there some strict naming convention in PHP, Symfony or Api platform preventing me for having an entity named FooTest.php?

Should i rename my entities, or does this regex needs to be a bit more permissive?

Thanks

Activity

added a commit that references this issue on Apr 10, 2025
ddc2734
soyuka

soyuka commented on Apr 10, 2025

@soyuka
Member

does my patch resolves your issue? ddc2734

added a commit that references this issue on Apr 10, 2025
03310f9
wtfred

wtfred commented on Apr 10, 2025

@wtfred
Author

Yes, thanks!

(That being said, problem could still happens on Laravel with entities named like mine, no?)

soyuka

soyuka commented on Apr 11, 2025

@soyuka
Member

Actually if I don't do this there are some issues as we will load pest tests and break cache warmup. Autoconfiguring in laravel is quite experimental to me. I also hope that I can find some energy to resolve #6943, when ApiResource attributes will be handled by symfony's DI component we can remove this code for the symfony integration it'll be much cleaner :)

added a commit that references this issue on Apr 11, 2025
694681f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @soyuka@wtfred

        Issue actions

          BC break from 4.1.2 if you have badly named entity? · Issue #7067 · api-platform/core