Skip to content

Latest commit

 

History

History
123 lines (104 loc) · 4.43 KB

UPGRADE-API-1.11.md

File metadata and controls

123 lines (104 loc) · 4.43 KB

UPGRADE FROM v1.10.X TO v1.11.0

  1. The product images should have a proper prefix (/media/image/) added to the path, so the images could be resolved. This is now done out of the box and response of Product Image resource is now:

        {
            "@context": "/api/v2/contexts/ProductImage",
            "@id": "/api/v2/shop/product-images/123",
            "@type": "ProductImage",
            "id": "123",
            "type": "thumbnail",
    -       "path": "uo/product.jpg",
    +       "path": "/media/image/uo/product.jpg"
        } 

    To change the prefix you need to set parameter in app/config/packages/_sylius.yaml:

    sylius_api:
        product_image_prefix: 'media/image'
  2. Sylius\Bundle\ApiBundle\Doctrine\Filters\ExchangeRateFilter and Sylius\Bundle\ApiBundle\Doctrine\Filters\TranslationOrderNameAndLocaleFilter has been moved to Sylius\Bundle\ApiBundle\Doctrine\Filter\ExchangeRateFilter and Sylius\Bundle\ApiBundle\Doctrine\Filter\TranslationOrderNameAndLocaleFilter respectively.

  3. Sylius\Bundle\ApiBundle\View\CartShippingMethodInterface and Sylius\Bundle\ApiBundle\View\CartShippingMethod have been removed.

  4. Sylius\Bundle\ApiBundle\View\Factory\CartShippingMethodFactoryInterface and Sylius\Bundle\ApiBundle\View\Factory\CartShippingMethodFactory have been removed.

  5. The constructor of Sylius\Bundle\ApiBundle\DataProvider\CartShippingMethodsSubresourceDataProvider has been changed:

        public function __construct(
            OrderRepositoryInterface $orderRepository,
            ShipmentRepositoryInterface $shipmentRepository,
            ShippingMethodsResolverInterface $shippingMethodsResolver,
    -       ServiceRegistryInterface $calculators,
    -       CartShippingMethodFactoryInterface $cartShippingMethodFactory
        ) {
            ...
        }
  6. The response schema for endpoint GET /api/v2/shop/orders/{tokenValue}/shipments/{shipments}/methods has been changed from:

    ...
    "hydra:member": [
        {
            ...
            "@type": "CartShippingMethod",
            "shippingMethod": {
                ...
                "price": 500
            }
        }
    ]
    

    to:

    ...
    "hydra:member": [
        {
            ...
            "@type": "ShippingMethod",
            ...
            "price": 500
        }
    ]
    
  7. Constructor of Core/OrderProcessing/OrderTaxesProcessor.php has been changed where new service implementing TaxationAddressResolverInterface will become mandatory from Sylius version 2.0:

        public function __construct(
            ZoneProviderInterface $defaultTaxZoneProvider,
            ZoneMatcherInterface $zoneMatcher,
            PrioritizedServiceRegistryInterface $strategyRegistry,
    +       ?TaxationAddressResolverInterface $taxationAddressResolver = null
        ) {
            ...
        }
  8. Constructor of ApiBundle/Serializer/ProductVariantNormalizer.php has been extended with SectionProviderInterface argument:

        public function __construct(
            ProductVariantPricesCalculatorInterface $priceCalculator,
            ChannelContextInterface $channelContext,
            AvailabilityCheckerInterface $availabilityChecker,
    +       SectionProviderInterface $uriBasedSectionContext
        ) {
            ...
        }
  9. Request body of POST api/v2/shop/addresses endpoint has been changed:

        {
    -       "customer": "string",
            "firstName": "string",
            "lastName": "string",
            "phoneNumber": "string",
            "company": "string",
            "countryCode": "string",
            "provinceCode": "string",
            "provinceName": "string",
            "street": "string",
            "city": "string",
            "postcode": "string"
        }
  10. The service Sylius\Bundle\ApiBundle\Converter\ItemIriToIdentifierConverter has changed its name to Sylius\Bundle\ApiBundle\Converter\IriToIdentifierConverter and its service definition from Sylius\Bundle\ApiBundle\Converter\ItemIriToIdentifierConverter to Sylius\Bundle\ApiBundle\Converter\IriToIdentifierConverterInterface

  11. The service Sylius\Bundle\ApiBundle\Serializer\CommandFieldItemIriToIdentifierDenormalizer has changed its name to Sylius\Bundle\ApiBundle\Serializer\CommandArgumentsDenormalizer and also its service definition.