api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 875 forks source link

[Laravel] 404 Format \"xxx\" is not supported when have 2 API with similar route #6779

Open chung1905 opened 1 week ago

chung1905 commented 1 week ago

API Platform version(s) affected: 4.0.6

Description
I'm using Laravel 11 and API Platform 4. I have 2 API Resource:

#[Entity]
#[ApiResource]
class Staff extends Model
{
}

and

#[Entity]
#[ApiResource]
class StaffPositionHistory extends Model
{
}

I believe the content doesn't matter so I tripped them down. When I calling to .../api/staff_position_histories?page=1 I got this 404 error: Format \"position_histories\" is not supported I debugged a bit and found, the operation it's matching Staff route instead of Staff Position History image

Is there any way I disable the {_format} in route matching for now?

soyuka commented 6 days ago

mhh indeed this is anoying, let me check that