-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
2.7.3 ignores the route_prefix
prefix settings
#5179
Comments
route_prefix
prefix settingsroute_prefix
prefix settings
route_prefix
prefix settingsroute_prefix
prefix settings
Hi @DarkChyper, I've tried to reproduce your bug locally, but couldn't get the same bug as you. Can you provide a reproducer, please? You can use a fork of api-platform/api-platform 😉 Here is the configuration I've tried, tested with both API Platform 2.7.4 (Symfony 5.4.15) and 3.0.4 (Symfony 6.1.7): # routes/api_platform.yaml
api_platform:
resource: .
type: api_platform
prefix: /symfony # config/packages/api_platform.yaml
api_platform:
# ...
metadata_backward_compatibility_layer: false # api-platform/core:^2.7 only
defaults:
route_prefix: /api #[ApiResource(routePrefix: 'v2')]
class Greeting #[ApiResource]
class Book When I list the routes (using Just to be clear: the |
Hi @vincentchalamon thanks for the answer ! I'll try to provide a reproducer, maybe the issue come from something with symfony 4.4.45 or yaml serializer (we don't use annotation on entities) |
Ah ok, it changes some things indeed. I can now reproduce the bug using the following configuration: resources:
App\Entity\Greeting:
routePrefix: v2
App\Entity\Book: ~ I only have the bug on API Platform 2.7, not on 3.0 |
ok so it seems that there is no bug with symfony 5.x and api platform 2.7. |
Should be fixed in #5194. Thanks for reporting this issue |
@vincentchalamon Is it intentional that the ApiResource-specific routePrefix will be ignored if the ApiResource only contains graphQlOperations? Example: #[ApiResource( operations: [], routePrefix: '/resourceSpecificPrefix', graphQlOperations: [ new Query(name: 'item_query'), new QueryCollection(name: 'collection_query'), ], )] If |
Hello @FPDK, |
there's no routes inside graphql no ? |
Hello,
I found this message in a closed issue named "Issues found on 2.7" because i reproduce this issue with 2.7.3 (SF 4.4.45 PHP 7.4)
route_prefix
is still ignored when i try to migrate from 2.6 to 2.7 (cannot go to 3.x now).I don't find any fix for this (but i'm not good to read PR, i could miss it)
edit: it works if i add setting on each resource :
config/api/resources/myresource.yaml
config/packages/api_platform.yaml
GET /users/{id} Retrieves a User resource.
Instead of
GET /api/users/{id} Retrieves a User resource.
Tested with d876e66
Originally posted by @lermontex in #4613 (comment)
The text was updated successfully, but these errors were encountered: