-
Notifications
You must be signed in to change notification settings - Fork 350
Description
Problem description
We want to remove the https://github.com/handcraftedinthealps/RestRoutingBundle as preperation for removing FOSRest.
The first step which we can already do on 2.6
is redefine all our routes in a new routing file yaml
instead of the old yml
and document that project should switch already to the new routing files.
https://github.com/sulu/skeleton/blob/2.6/config/routes/sulu_admin.yaml
Proposed solution
Skeleton: config/routes/sulu_admin.yaml
:
sulu_tag_api:
- resource: "@SuluTagBundle/Resources/config/routing_api.yml"
- type: rest
+ resource: "@SuluTagBundle/Resources/config/routing_api.yaml"
prefix: /admin/api
Sulu: src/Sulu/Bundle/TagBundle/Resources/config/routing_api.yml
(keep as it is on 2.6) (remove on 3.0):
sulu_tag.tags:
type: rest
name_prefix: sulu_tag.
resource: sulu_tag.tag_controller
sulu_tag.post_tag_merge:
path: /tags/merge.{_format}
methods: POST
defaults:
_controller: sulu_tag.tag_controller::postMergeAction
_format: json
Sulu: src/Sulu/Bundle/TagBundle/Resources/config/routing_api.yaml
(add to 2.6):
sulu_tag.get_tag:
path: /tags/{id}.{_format}
controller: sulu_tag.tag_controller::getAction
methods: GET
format: json
requirements:
_format: json|csv
sulu_tag.get_tags:
path: /tags.{_format}
controller: sulu_tag.tag_controller::cgetAction
methods: GET
format: json
requirements:
_format: json|csv
sulu_tag.post_tag:
path: /tags.{_format}
controller: sulu_tag.tag_controller::postAction
methods: POST
format: json
requirements:
_format: json|csv
sulu_tag.put_tag:
path: /tags/{id}.{_format}
controller: sulu_tag.tag_controller::putAction
methods: PUT
format: json
requirements:
_format: json|csv
sulu_tag.delete_tag:
path: /tags/{id}.{_format}
controller: sulu_tag.tag_controller::deleteAction
methods: DELETE
format: json
requirements:
_format: json|csv
sulu_tag.patch_tags:
path: /tags.{_format}
controller: sulu_tag.tag_controller::cpatchAction
methods: PATCH
format: json
requirements:
_format: json|csv
sulu_tag.post_tag_merge:
path: /tags/merge.{_format}
controller: sulu_tag.tag_controller::postMergeAction
methods: POST
format: json
requirements:
_format: json|csv
When changing from yml
to yaml
the output of the both routing should be nearly similar when running bin/console debug:router --format json
.
TODO
- AdminBundle Migrate rest routings to default symfony routing files of AdminBundle #7512
- ActivityBundle Migrate rest routings to default symfony routing files of ActivityBundle #7515
- AudienceTargetingBundle Migrate rest routings to default symfony routing files of AudienceTargetingBundle #8009
- CategoryBundle Migrate rest routings to default symfony routing files of CategoryBundle #8005
- ContactBundle Migrate rest routings to default symfony routing files of ContactBundle #8001
- CoreBundle Migrate rest routings to default symfony routing files of CoreBundle #8007
- CustomUrlsBundle Migrate rest routings to default symfony routing files of PageBundle, WebsiteBundle and CustomUrlBundle #8003
- RouteBundle Migrate rest routings to default symfony routing files of RouteBundle #8008
- MediaBundle Migrate rest routings to default symfony routing files of MediaBundle #8004
- PageBundle Migrate rest routings to default symfony routing files of PageBundle, WebsiteBundle and CustomUrlBundle #8003
- PreviewBundle Migrate rest routings to default symfony routing files of PreviewBundle #7526
- SecurityBundle Migrate rest routings to default symfony routing files of SecurityBundle #8002
- SearchBundle Migrate rest routings to default symfony routing files of SearchBundle #7516
- SnippetBundle Migrate rest routings to default symfony routing files of SnippetBundle #8006
- TagBundle Migrate rest routings to default symfony routing files of TagBundle #7511
- TrashBundle Migrate rest routings to default symfony routing files of TrashBundle #7514
- ReferenceBundle Migrate rest routings to default symfony routing files of ReferenceBundle #7513
- WebsiteBundle Migrate rest routings to default symfony routing files of PageBundle, WebsiteBundle and CustomUrlBundle #8003
None rest routes to yaml:
- AdminBundle
- LocationBundle
- MediaBundle
- WebsiteBundle
None core bundles:
- sulu/SuluFormBundle
- sulu/SuluCommentBundle
- sulu/SuluRedirectBundle
- sulu/SuluContentBundle
- sulu/SuluArticleBundle
- sulu/SuluHeadlessBundle
- sulu/SuluSyliusConsumerBundle
- sulu/SuluSyliusProducerPlugin
- sulu/SuluAutomationBundle
- sulu/SuluCommunityBundle
Todo:
- Check SecuredControllerInterface functionality without Rest Routing