I have create gift card product types and add custom options like this
- Choose Amount:Card value
 - select a design:
 compose your email :
To : Recipient Name Recipient Email Form : Sender Name Sender Email- Headline:
 - Message:
 - Date to send:
 - Time Zone
 
I added product into add to cart But, product is not update mini cart and checkout/cart page display error like this : 
Exception #0 (InvalidArgumentException): Unable to unserialize value. #0 vendor/magento/module-catalog/Helper/Product/Configuration.php(118): Magento\Framework \Serialize\Serializer\Json->unserialize.
How to solve this type issue?
I tried the answers from "Magento 2.2 error: Unable to unserialize value" but this is not working.
- 
 i have already used this link but not working @Siarhey UchukhlebauRavindrasinh Zala– Ravindrasinh Zala2017年12月06日 10:10:04 +00:00Commented Dec 6, 2017 at 10:10
 - 
 Try to debug from where this error comes (in backend). Check is taht error are reproducing when all third-party modules are disabled.Siarhey Uchukhlebau– Siarhey Uchukhlebau2017年12月06日 10:14:09 +00:00Commented Dec 6, 2017 at 10:14
 - 
 now i am use magento 2.2.0 fresh version. @Siarhey UchukhlebauRavindrasinh Zala– Ravindrasinh Zala2017年12月06日 11:05:14 +00:00Commented Dec 6, 2017 at 11:05
 
1 Answer 1
Now i have got the solution.
app/code/Vendor/Module/Helper/Data.php
 public function getUnserializeData($data)
 {
 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $version = $objectManager->get('Magento\Framework\App\ProductMetadataInterface')->getVersion();
 if($version >= '2.2.0'){
 $returnData = $objectManager->get('Magento\Framework\Serialize\SerializerInterface')->unserialize($data);
 }
 else{
 $returnData = (array) unserialize($data);
 }
 return $returnData; 
 }
 public function getSerializeData($data)
 {
 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $version = $objectManager->get('Magento\Framework\App\ProductMetadataInterface')->getVersion();
 if($version >= '2.2.0'){
 $returnData = $objectManager->get('Magento\Framework\Serialize\SerializerInterface')->serialize($data);
 }
 else{
 $returnData = serialize($data);
 }
 return $returnData; 
 }
app/code/Vendor/Module/Observer/CheckoutCartProductAddAfterObserver.php
 $additionalOptions = [];
 if ($additionalOption = $item->getOptionByCode('additional_options')) {
 $additionalOptions = $this->_helper->getUnserializeData($additionalOption->getValue());
 }
 if (count($additionalOptions) > 0) {
 $item->addOption([
 'code' => 'additional_options',
 'value' => $this->_helper->getSerializeData($additionalOptions)
 ]);
 }
 - 
 1my magento version is 2.2.5 but its not work. any other solution?Jigs Parmar– Jigs Parmar2018年07月13日 10:39:45 +00:00Commented Jul 13, 2018 at 10:39
 - 
 It could be better with dependency injection. It is a good answer though. Upvote from my side :)Dinesh Yadav– Dinesh Yadav2018年10月18日 10:59:58 +00:00Commented Oct 18, 2018 at 10:59