0

magento-connctor の get-product 操作から次の応答が返されます。

{"product_id":"33","sku":"TEST","set":"18","type":"bundle","categories":["2","4","5","16","17","222"],"website["1","3","5","16"],"created_at":null,"updated_at":null,"type_id":null,"name":"test","description":null,"short_description":"test description","weight":null,"status":null,"url_key":null,"url_path":null,"visibility":null,"category_ids":null,"website_ids":null,"has_options":null,"gift_message_available":null,"price":null,"special_price":null,"special_from_date":null,"special_to_date":null,"tax_class_id":null,"tier_price":null,"meta_title":null,"meta_keyword":null,"meta_description":null,"custom_design":null,"custom_layout_update":null,"options_container":null,"additional_attributes":[{"key":"highlights","value":"testing Highlights"},{"key":"test_details","value":null},{"key":"frequently_asked_questions","value":"test_faq"}],"enable_googlecheckout":null}

属性でフィルタリングし、ペイロードから一部のデータを削除するにはどうすればよいですか?

4

1 に答える 1

1

Dataweave (Anypoint Studio の Transform Message コンポーネント)を使用できます。ドキュメントを参照してください。

https://docs.mulesoft.com/mule-user-guide/v/3.7/using-dataweave-in-studio

データを含むサンプル スクリプト:

%dw 1.0
%output application/json
---
{
    product_id: payload.product_id,
    sku: payload.sku,
    set: payload.set,
    type: payload.type,
    categories: payload.categories map ((category , indexOfCategory) -> category),
    website: payload.website map ((website , indexOfWebsite) -> website),
    created_at: payload.created_at
}
于 2015-12-31T17:58:37.797 に答える