VS Code 中的液体映射失败

发布于 2025-01-13 03:04:45 字数 6670 浏览 3 评论 0原文

好吧,我有一个简单的映射,我正在使用 VS 代码的 Shopify 预览插件来查看我在代码中做了什么。但我在田里什么也没得到。

这是我的 Liquid 代码,

{
    "contact":{
    
    "matchKey": "{{content.Content.CrmId}}",
    "matchKeyType": "{{content.Content.Owner}}" 
    }
    
}

我想从 Json 中提取信息并创建另一个 json 输出模式。 下面是输入模式:

{
    "content":{
    "Name": "dwadwadwa",
    "Version": "string",
    "Sender": "TEST",
    "Content": {
        "OrderNumber": "string",
        "OrderGroupId": 0,
        "AffiliateId": "string",
        "BillingCurrency": "string",
        "CustomerId": "string",
        "CrmId": "string",
        "CustomerName": "string",
        "HandlingTotal": 0,
        "MarketId": "string",
        "Name": "string",
        "Owner": "string",
        "OwnerOrg": "string",
        "ShippingTotal": 0,
        "Status": "string",
        "SubTotal": 0,
        "TaxTotal": 0,
        "Total": 0,
        "Modified": "string",
        "Created": "string",
        "Properties": [
            {
                "Key": "string",
                "Value": "string"
            }
        ],
        "Forms": [
            {
                "ReturnComment": "string",
                "ReturnType": "string",
                "ReturnAuthCode": "string",
                "OrderFormId": 0,
                "Name": "string",
                "ReceiptNumber": "string",
                "BillingAddressId": "string",
                "ShippingTotal": 0,
                "HandlingTotal": 0,
                "TaxTotal": 0,
                "DiscountAmount": 0,
                "SubTotal": 0,
                "Total": 0,
                "Status": "string",
                "AuthorizedPaymentTotal": 0,
                "CapturedPaymentTotal": 0,
                "Properties": [
                    {
                        "Key": "string",
                        "Value": "string"
                    }
                ],
                "Payments": [
                    {
                        "Amount": 0,
                        "AuthorizationCode": "string",
                        "CustomerName": "string",
                        "PaymentId": "string",
                        "PaymentMethodId": "string",
                        "PaymentMethodName": "string",
                        "PaymentTypeModel": "string",
                        "Status": "string",
                        "TransactionType": "string",
                        "ValidationCode": "string",
                        "Properties": [
                            {
                                "Key": "string",
                                "Value": "string"
                            }
                        ]
                    }
                ],
                "Shipments":
                    {
                        "ShipmentId": 0,
                        "ShippingMethodId": "string",
                        "ShippingMethodName": "string",
                        "ShippingTax": 0,
                        "ShippingAddressId": "string",
                        "ShipmentTrackingNumber": "string",
                        "ShippingDiscountAmount": 0,
                        "ShippingSubTotal": 0,
                        "ShippingTotal": 0,
                        "Status": "string",
                        "PrevStatus": "string",
                        "PickListId": "string",
                        "SubTotal": 0,
                        "WarehouseCode": "string",
                        "PickupPoint": "string",
                        "Properties": [
                            {
                                "Key": "string",
                                "Value": "string"
                            }
                        ],
                        "DiscountsModel": [
                            {
                                "DiscountId": 0,
                                "DiscountAmount": 0,
                                "DiscountCode": "string",
                                "DiscountName": "string",
                                "DisplayMessage": "string",
                                "DiscountValue": 0
                            }
                        ],
                        "LineItems": [
                            {
                                "LineItemId": 0,
                                "Code": "string",
                                "DisplayName": "string",
                                "PlacedPrice": 0,
                                "ExtendedPrice": 0, 
                                "DiscountedPrice": 0, 
                                "SalesTax": 0, 
                                "TaxCategoryId": 0,
                                "Quantity": 0,
                                "ShippedQuantity": 0,
                                "ReturnQuantity": 0,
                                "InventoryTrackingStatus": "string",
                                "IsInventoryAllocated": true,
                                "IsGift": true,
                                "DeliveryInfo": "string",
                                "ProductUrl": "string",
                                "ImageUrl": "string",
                                "Properties": [
                                    {
                                        "Key": "string",
                                        "Value": "string"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "OrderAddresses": [
            {
                "OrderGroupAddressId": 0,
                "Name": "string",
                "FirstName": "string",
                "LastName": "string",
                "Organization": "string",
                "Line1": "string",
                "Line2": "string",
                "City": "string",
                "State": "string",
                "CountryCode": "string",
                "CountryName": "string",
                "PostalCode": "string",
                "RegionCode": "string",
                "RegionName": "string",
                "DaytimePhoneNumber": "string",
                "EveningPhoneNumber": "string",
                "Email": "string",
                "Properties": [
                    {
                        "Key": "string",
                        "Value": "string"
                    }
                ]
            }
        ]
    }
}
}

任何人都知道这有什么问题,我有点迷路,在互联网上找不到任何东西。

顺便说一句,这是我的输出

{
    "contact":{
    
    "matchKey": "",
    "matchKeyType": "" 
    }
    
}

Alright so I have a simple mapping and I'm using my self of shopify preview plugin for VS code to see what I'm doing in the code. But I'm not getting anything in the fields.

This is my Liquid Code

{
    "contact":{
    
    "matchKey": "{{content.Content.CrmId}}",
    "matchKeyType": "{{content.Content.Owner}}" 
    }
    
}

I want to extract the information from the Json and create another json output schema.
Below is the input schema:

{
    "content":{
    "Name": "dwadwadwa",
    "Version": "string",
    "Sender": "TEST",
    "Content": {
        "OrderNumber": "string",
        "OrderGroupId": 0,
        "AffiliateId": "string",
        "BillingCurrency": "string",
        "CustomerId": "string",
        "CrmId": "string",
        "CustomerName": "string",
        "HandlingTotal": 0,
        "MarketId": "string",
        "Name": "string",
        "Owner": "string",
        "OwnerOrg": "string",
        "ShippingTotal": 0,
        "Status": "string",
        "SubTotal": 0,
        "TaxTotal": 0,
        "Total": 0,
        "Modified": "string",
        "Created": "string",
        "Properties": [
            {
                "Key": "string",
                "Value": "string"
            }
        ],
        "Forms": [
            {
                "ReturnComment": "string",
                "ReturnType": "string",
                "ReturnAuthCode": "string",
                "OrderFormId": 0,
                "Name": "string",
                "ReceiptNumber": "string",
                "BillingAddressId": "string",
                "ShippingTotal": 0,
                "HandlingTotal": 0,
                "TaxTotal": 0,
                "DiscountAmount": 0,
                "SubTotal": 0,
                "Total": 0,
                "Status": "string",
                "AuthorizedPaymentTotal": 0,
                "CapturedPaymentTotal": 0,
                "Properties": [
                    {
                        "Key": "string",
                        "Value": "string"
                    }
                ],
                "Payments": [
                    {
                        "Amount": 0,
                        "AuthorizationCode": "string",
                        "CustomerName": "string",
                        "PaymentId": "string",
                        "PaymentMethodId": "string",
                        "PaymentMethodName": "string",
                        "PaymentTypeModel": "string",
                        "Status": "string",
                        "TransactionType": "string",
                        "ValidationCode": "string",
                        "Properties": [
                            {
                                "Key": "string",
                                "Value": "string"
                            }
                        ]
                    }
                ],
                "Shipments":
                    {
                        "ShipmentId": 0,
                        "ShippingMethodId": "string",
                        "ShippingMethodName": "string",
                        "ShippingTax": 0,
                        "ShippingAddressId": "string",
                        "ShipmentTrackingNumber": "string",
                        "ShippingDiscountAmount": 0,
                        "ShippingSubTotal": 0,
                        "ShippingTotal": 0,
                        "Status": "string",
                        "PrevStatus": "string",
                        "PickListId": "string",
                        "SubTotal": 0,
                        "WarehouseCode": "string",
                        "PickupPoint": "string",
                        "Properties": [
                            {
                                "Key": "string",
                                "Value": "string"
                            }
                        ],
                        "DiscountsModel": [
                            {
                                "DiscountId": 0,
                                "DiscountAmount": 0,
                                "DiscountCode": "string",
                                "DiscountName": "string",
                                "DisplayMessage": "string",
                                "DiscountValue": 0
                            }
                        ],
                        "LineItems": [
                            {
                                "LineItemId": 0,
                                "Code": "string",
                                "DisplayName": "string",
                                "PlacedPrice": 0,
                                "ExtendedPrice": 0, 
                                "DiscountedPrice": 0, 
                                "SalesTax": 0, 
                                "TaxCategoryId": 0,
                                "Quantity": 0,
                                "ShippedQuantity": 0,
                                "ReturnQuantity": 0,
                                "InventoryTrackingStatus": "string",
                                "IsInventoryAllocated": true,
                                "IsGift": true,
                                "DeliveryInfo": "string",
                                "ProductUrl": "string",
                                "ImageUrl": "string",
                                "Properties": [
                                    {
                                        "Key": "string",
                                        "Value": "string"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "OrderAddresses": [
            {
                "OrderGroupAddressId": 0,
                "Name": "string",
                "FirstName": "string",
                "LastName": "string",
                "Organization": "string",
                "Line1": "string",
                "Line2": "string",
                "City": "string",
                "State": "string",
                "CountryCode": "string",
                "CountryName": "string",
                "PostalCode": "string",
                "RegionCode": "string",
                "RegionName": "string",
                "DaytimePhoneNumber": "string",
                "EveningPhoneNumber": "string",
                "Email": "string",
                "Properties": [
                    {
                        "Key": "string",
                        "Value": "string"
                    }
                ]
            }
        ]
    }
}
}

Anyone know what is wrong with this i'm kinda lost and cannot find anything on the internet.

This is my output btw

{
    "contact":{
    
    "matchKey": "",
    "matchKeyType": "" 
    }
    
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文