-
API is disabled by default, to enable it you need to set flag to
trueinconfig/packages/_sylius.yaml:sylius_api: enabled: true
-
Sylius\Bundle\ApiBundle\DataProvider\OrderCollectionDataProviderhas been removed and the same logic is now implemented inSylius\Bundle\ApiBundle\Doctrine\QueryCollectionExtension\OrdersByLoggedInUserExtension -
The service
Sylius\Bundle\ApiBundle\Serializer\ProductVariantSerializerhas been changed toSylius\Bundle\ApiBundle\Serializer\ProductVariantNormalizerand its first argumentNormalizerInterface $objectNormalizerhas been removed from constructor.
- The endpoint
GET api/v2/order-items/{id}/adjustmentshas been changed toGET api/v2/admin/order-items/{id}/adjustments
/new-apiprefix has been changed to/api/v2. Please adjust your routes accordingly. Admin API is hardcoded to/api/v1instead of/api/v{version}.
-
Adjust your
config/packages/security.yaml.-
Parameters from
config/packages/security.yamlhas been moved to separated bundles. You may delete them if you are using the default values:- parameters: - sylius.security.admin_regex: "^/%sylius_admin.path_name%" - sylius.security.api_regex: "^/api/v1" - sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|api/.*|api$|media/.*)[^/]++" - sylius.security.new_api_route: "/api/v2" - sylius.security.new_api_regex: "^%sylius.security.new_api_route%" - sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin" - sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%" - sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop" - sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%"
-
If you are not using the default values, you may need to add and change parameters:
parameters: - sylius.security.api_regex: "^/api" - sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++" - sylius.security.new_api_route: "/new-api" + sylius.security.api_regex: "^/api/v1" + sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|api/.*|api$|media/.*)[^/]++" + sylius.security.new_api_route: "/api/v2" + sylius.security.new_api_user_account_route: "%sylius.security.new_api_shop_route%/account" + sylius.security.new_api_user_account_regex: "^%sylius.security.new_api_user_account_route%"
-
Add new access control configuration and reorder it:
security: access_control: + - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - - { path: "%sylius.security.new_api_route%/admin/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_route%/shop/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }
-
-
Unified API registration path in shop has been changed from
/new-api/shop/registerto/new-api/shop/customers/. -
Identifier needed to retrieve a product in shop API endpoint (
/new-api/shop/products/{id}) has been changed fromslugtocode. -
config/packages/fos_rest.yamlrules have been changed to:rules: - - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } + - { path: '^/api/v1/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
-
To have better control over the serialization process, we introduced
shopandadminprefixes to names of serialization groups onsrc/Sylius/Bundle/ApiBundle/Resources/config/api_resources/*andsrc/Sylius/Bundle/ApiBundle/Resources/config/serialization/*. Several additional serialization groups have been rephrased, to improve readability and predictability of them. If you are using they on your custom entityapi_resourceconfiguration or serialization groups, you should check if one of these changes may affect on your app. If yes, change all occurs by this pattern:
- created serialization groups for
Localeresource as:admin:locale:readandadmin:locale:create adjustment:readchanged to:admin:adjustment:readandshop:adjustment:readadmin_user:createchanged to:admin:admin_user:createadmin_user:readchanged to:admin:admin_user:readadmin_user:updatechanged to:admin:admin_user:updateavatar_image:readchanged to:admin:avatar_image:readcart:add_itemchanged to:shop:cart:add_itemcart:addresschanged to:shop:cart:addresscart:apply_couponchanged to:shop:cart:apply_couponcart:change_quantitychanged to:shop:cart:change_quantitycart:completechanged to:shop:cart:completecart:remove_itemchanged to:shop:cart:remove_itemcart:select_payment_methodchanged to:shop:cart:select_payment_methodcart:select_shipping_methodchanged to:shop:cart:select_shipping_methodcart:updatechanged to:shop:cart:updatechannel:createchanged to:admin:channel:createchannel:readchanged to:admin:channel:readcheckout:readchanged to:shop:cart:readcountry:readchanged to:admin:country:readcurrency:readchanged to:admin:currency:readcustomer:password:writechanged to:shop:customer:password:updatecustomer:readchanged to:admin:customer:readandshop:customer:readcustomer:updatechanged to:shop:customer:updatecustomer_group:createchanged to:admin:customer_group:createcustomer_group:readchanged to:admin:customer_group:readcustomer_group:updatechanged to:admin:customer_group:updateexchange_rate:createchanged to:admin:exchange_rate:createexchange_rate:readchanged to:admin:exchange_rate:readexchange_rate:updatechanged to:admin:exchange_rate:updateorder:createchanged to:shop:order:createorder:readchanged to:admin:order:readorder:updatechanged to:admin:order:updateorder_item:readchanged to:admin:order_item:readandshop:order_item:readorder_item_unit:readchanged to:admin:order_item_unit:readandshop:order_item_unit:readpayment:readchanged to:admin:payment:readandshop:payment:readpayment_method:readchanged to:admin:payment_method:readandshop:payment_method:readproduct:createchanged to:admin:product:createproduct:readchanged to:admin:product:readandshop:product:readproduct:updatechanged to:admin:product:updateprovince:readchanged to:admin:province:readprovince:updatechanged to:admin:province:updateshipment:readchanged to:admin:shipment:readandshop:shipment:readshipment:updatechanged to:admin:shipment:updateshipping_category:createchanged to:admin:shipping_category:createshipping_category:readchanged to:admin:shipping_category:readshipping_category:updatechanged to:admin:shipping_category:updateshipping_method:createchanged to:admin:shipping_method:createshipping_method:readchanged to:admin:shipping_method:readshipping_method:updatechanged to:admin:shipping_method:updateshop:currencies:readchanged to:shop:currency:readshop:customer:writechanged to:shop:customer:createshop_billing_data:readchanged to:admin:shop_billing_data:readtax_category:readchanged to:admin:tax_category:readtax_category:updatechanged to:admin:tax_category:updatetax_category:createchanged to:admin:tax_category:createtaxon:readchanged to:admin:taxon:readandshop:taxon:readtaxon:updatechanged to:admin:taxon:updatetaxon:createchanged to:admin:taxon:createzone:readchanged to:admin:zone:readzone:updatechanged to:admin:zone:updatezone:createchanged to:admin:zone:createzone_member:readchanged to:admin:zone_member:read- removed redundant
zone_member:write