Skip to content

Commit

Permalink
minor #15803 Duplicate all serializer groups with sylius prefix (Rafi…
Browse files Browse the repository at this point in the history
…kooo)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | no                                                      |
| New feature?    | no                                                      |
| BC breaks?      | no                                                      |
| Deprecations?   | yes <!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

To avoid conflicts with duplicated naming for the end apps, we have introduced prefixed serialization groups in the Sylius serialization groups configurations.

Commits
-------
  [ApiBundle] Duplicate all serializer groups with sylius prefix
  [CoreBundle] Duplicate all serializer groups with sylius prefix
  [ApiBundle] Duplicate all resources normalization and denormalization config groups with sylius prefix
  [Upgrade] Note new sylius prefix in serialization groups
  [ApiBundle][Tests] Duplicate all resources normalization and denormalization config groups with sylius prefix
  • Loading branch information
NoResponseMate committed Feb 7, 2024
2 parents 7e34b0e + 1b29548 commit 7735d06
Show file tree
Hide file tree
Showing 146 changed files with 3,039 additions and 279 deletions.
8 changes: 8 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# UPGRADE FROM `v1.X.X` TO `v2.0.0`

1. Non-prefix serialization groups in Sylius resources have been removed.
If you have extended any of them, you must prefix them with `sylius:`, for example:

```diff
- #[Groups(['admin:product:index'])]
+ #[Groups(['sylius:admin:product:index'])]
```

## Codebase

* Doctrine MongoDB and PHPCR is not longer supported in ResourceBundle and GridBundle:
Expand Down
4 changes: 4 additions & 0 deletions UPGRADE-API-1.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
skip_adding_read_group: true
```

1. Sylius serialization groups have been updated with a new prefix of `sylius:some_resource`.
If you extend any of the Sylius resources, you should update your serialization groups to use the new prefix.
Non-prefix serialization groups are deprecated and will be removed in Sylius 2.0.

1. The constructor of `Sylius\Bundle\ApiBundle\Serializer\ChannelDenormalizer` has been changed:

```diff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<attribute name="output">false</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:reset_password:create</attribute>
<attribute name="groups">
<attribute>shop:reset_password:create</attribute>
<attribute>sylius:shop:reset_password:create</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Requests password reset</attribute>
Expand All @@ -43,7 +46,10 @@
<attribute name="output">false</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:reset_password:update</attribute>
<attribute name="groups">
<attribute>shop:reset_password:update</attribute>
<attribute>sylius:shop:reset_password:update</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Resets password</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,27 @@
<attribute name="method">GET</attribute>
<attribute name="path">/shop/addresses</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:index</attribute>
<attribute name="groups">
<attribute>shop:address:index</attribute>
<attribute>sylius:shop:address:index</attribute>
</attribute>
</attribute>
</collectionOperation>

<collectionOperation name="shop_post">
<attribute name="method">POST</attribute>
<attribute name="path">/shop/addresses</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:address:create</attribute>
<attribute name="groups">
<attribute>shop:address:create</attribute>
<attribute>sylius:shop:address:create</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:show</attribute>
<attribute name="groups">
<attribute>shop:address:show</attribute>
<attribute>sylius:shop:address:show</attribute>
</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -42,6 +51,7 @@
<attribute name="normalization_context">
<attribute name="groups">
<attribute>admin:address:show</attribute>
<attribute>sylius:admin:address:show</attribute>
</attribute>
</attribute>
</itemOperation>
Expand All @@ -52,11 +62,13 @@
<attribute name="denormalization_context">
<attribute name="groups">
<attribute>admin:address:update</attribute>
<attribute>sylius:admin:address:update</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">
<attribute>admin:address:show</attribute>
<attribute>sylius:admin:address:show</attribute>
</attribute>
</attribute>
</itemOperation>
Expand All @@ -66,7 +78,10 @@
<attribute name="path">/admin/addresses/{id}/log-entries</attribute>
<attribute name="controller">Sylius\Bundle\ApiBundle\Controller\GetAddressLogEntryCollectionAction</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:address:log_entry:show</attribute>
<attribute name="groups">
<attribute>admin:address:log_entry:show</attribute>
<attribute>sylius:admin:address:log_entry:show</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Retrieves the collection of AddressLogEntry resources.</attribute>
Expand All @@ -78,7 +93,10 @@
<attribute name="method">GET</attribute>
<attribute name="path">/shop/addresses/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:show</attribute>
<attribute name="groups">
<attribute>shop:address:show</attribute>
<attribute>sylius:shop:address:show</attribute>
</attribute>
</attribute>
</itemOperation>

Expand All @@ -91,10 +109,16 @@
<attribute name="method">PUT</attribute>
<attribute name="path">/shop/addresses/{id}</attribute>
<attribute name="denormalization_context">
<attribute name="groups">shop:address:update</attribute>
<attribute name="groups">
<attribute>shop:address:update</attribute>
<attribute>sylius:shop:address:update</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:address:show</attribute>
<attribute name="groups">
<attribute>shop:address:show</attribute>
<attribute>sylius:shop:address:show</attribute>
</attribute>
</attribute>
</itemOperation>
</itemOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<attribute>sylius.api.order_token_filter</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:adjustment:index</attribute>
<attribute name="groups">
<attribute>admin:adjustment:index</attribute>
<attribute>sylius:admin:adjustment:index</attribute>
</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -34,28 +37,40 @@
<attribute name="method">GET</attribute>
<attribute name="path">/admin/adjustments/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:adjustment:show</attribute>
<attribute name="groups">
<attribute>admin:adjustment:show</attribute>
<attribute>sylius:admin:adjustment:show</attribute>
</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/adjustments/{id}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:adjustment:show</attribute>
<attribute name="groups">
<attribute>shop:adjustment:show</attribute>
<attribute>sylius:shop:adjustment:show</attribute>
</attribute>
</attribute>
</itemOperation>
</itemOperations>

<subresourceOperations>
<subresourceOperation name="api_orders_adjustments_get_subresource">
<attribute name="normalization_context">
<attribute name="groups">shop:cart:show</attribute>
<attribute name="groups">
<attribute>shop:cart:show</attribute>
<attribute>sylius:shop:cart:show</attribute>
</attribute>
</attribute>
</subresourceOperation>
<subresourceOperation name="api_orders_items_adjustments_get_subresource">
<attribute name="normalization_context">
<attribute name="groups">shop:cart:show</attribute>
<attribute name="groups">
<attribute>shop:cart:show</attribute>
<attribute>sylius:shop:cart:show</attribute>
</attribute>
</attribute>
</subresourceOperation>
</subresourceOperations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<attribute name="output">false</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:reset_password:create</attribute>
<attribute name="groups">
<attribute>admin:reset_password:create</attribute>
<attribute>sylius:admin:reset_password:create</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Requests administrator's password reset</attribute>
Expand All @@ -43,7 +46,10 @@
<attribute name="output">false</attribute>
<attribute name="status">202</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:reset_password:update</attribute>
<attribute name="groups">
<attribute>admin:reset_password:update</attribute>
<attribute>sylius:admin:reset_password:update</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="summary">Resets administrator's password</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<collectionOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:index</attribute>
<attribute name="groups">
<attribute>admin:admin_user:index</attribute>
<attribute>sylius:admin:admin_user:index</attribute>
</attribute>
</attribute>
</collectionOperation>

Expand All @@ -35,10 +38,16 @@
<attribute>sylius_user_create</attribute>
</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:admin_user:create</attribute>
<attribute name="groups">
<attribute>admin:admin_user:create</attribute>
<attribute>sylius:admin:admin_user:create</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:show</attribute>
<attribute name="groups">
<attribute>admin:admin_user:show</attribute>
<attribute>sylius:admin:admin_user:show</attribute>
</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -47,17 +56,26 @@
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:show</attribute>
<attribute name="groups">
<attribute>admin:admin_user:show</attribute>
<attribute>sylius:admin:admin_user:show</attribute>
</attribute>
</attribute>
</itemOperation>

<itemOperation name="admin_put">
<attribute name="method">PUT</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:admin_user:update</attribute>
<attribute name="groups">
<attribute>admin:admin_user:update</attribute>
<attribute>sylius:admin:admin_user:update</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:admin_user:show</attribute>
<attribute name="groups">
<attribute>admin:admin_user:show</attribute>
<attribute>sylius:admin:admin_user:show</attribute>
</attribute>
</attribute>
</itemOperation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:avatar_image:show</attribute>
<attribute name="groups">
<attribute>admin:avatar_image:show</attribute>
<attribute>sylius:admin:avatar_image:show</attribute>
</attribute>
</attribute>
</collectionOperation>
</collectionOperations>
Expand All @@ -54,7 +57,10 @@
<itemOperation name="admin_get">
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:avatar_image:show</attribute>
<attribute name="groups">
<attribute>admin:avatar_image:show</attribute>
<attribute>sylius:admin:avatar_image:show</attribute>
</attribute>
</attribute>
</itemOperation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,27 @@
<attribute>sylius.api.order_filter.priority</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:index</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:index</attribute>
<attribute>sylius:admin:catalog_promotion:index</attribute>
</attribute>
</attribute>
</collectionOperation>

<collectionOperation name="admin_post">
<attribute name="path">/admin/catalog-promotions</attribute>
<attribute name="method">POST</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:catalog_promotion:create</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:create</attribute>
<attribute>sylius:admin:catalog_promotion:create</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:show</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:show</attribute>
<attribute>sylius:admin:catalog_promotion:show</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="description">
Expand Down Expand Up @@ -84,26 +93,38 @@ Example configuration for `percentage_discount` action type:
<attribute name="path">/admin/catalog-promotions/{code}</attribute>
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:show</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:show</attribute>
<attribute>sylius:admin:catalog_promotion:show</attribute>
</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_get">
<attribute name="path">/shop/catalog-promotions/{code}</attribute>
<attribute name="method">GET</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:catalog_promotion:show</attribute>
<attribute name="groups">
<attribute>shop:catalog_promotion:show</attribute>
<attribute>sylius:shop:catalog_promotion:show</attribute>
</attribute>
</attribute>
</itemOperation>

<itemOperation name="admin_put">
<attribute name="path">/admin/catalog-promotions/{code}</attribute>
<attribute name="method">PUT</attribute>
<attribute name="denormalization_context">
<attribute name="groups">admin:catalog_promotion:update</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:update</attribute>
<attribute>sylius:admin:catalog_promotion:update</attribute>
</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">admin:catalog_promotion:show</attribute>
<attribute name="groups">
<attribute>admin:catalog_promotion:show</attribute>
<attribute>sylius:admin:catalog_promotion:show</attribute>
</attribute>
</attribute>
<attribute name="openapi_context">
<attribute name="description">
Expand Down
Loading

0 comments on commit 7735d06

Please sign in to comment.