public function getDecorated(): AbstractContextSwitchRoute
{ throw new DecorationPatternException(self::
class);
} #[Route(path: '/store-api/context', name: 'store-api.switch-context', methods: ['PATCH'])]
public function switchContext(RequestDataBag
$data, SalesChannelContext
$context): ContextTokenResponse
{ $definition =
new DataValidationDefinition('context_switch'
);
$parameters =
$data->
only( self::SHIPPING_METHOD_ID,
self::PAYMENT_METHOD_ID,
self::BILLING_ADDRESS_ID,
self::SHIPPING_ADDRESS_ID,
self::COUNTRY_ID,
self::STATE_ID,
self::CURRENCY_ID,
self::LANGUAGE_ID
);
// pre validate to ensure correct data type. Existence of entities is checked later