Deserialize variable meta object with serde
问题 I am looking an elegant way to deserialize the following input: { "products": [ { "id": 1, "ptype": "Clothes", "description": "some data about clothes", "metadata": { "colors" : ["blue", "green"], "web": false, "size": 2 } }, { "id": 4, "ptype": "Food", "description": "text for foods", "metadata": { "country": "France", "wine": true } }, { "id": 12, "ptype": "EmptyPlaceholder", "description": "nothing at all", "metadata": { } } ] } The json contains an array of products. A product can be