[Asset update] Adapt frontend to use correct payload and endpoints
Opened this issue · 1 comments
Description:
When an update is sent to the asset update endpoint, not all values are updated correctly.
Reproduction:
Example request payload:
{"data":{"properties":[{"key":"My predefined property","type":"text","data":"test test","inherited":false,"inheritable":false,"additionalAttributes":[],"config":"","description":"tes test","predefinedName":"My predefined property"}]}}
Current behavior:
The predefined property is automatically converted to a custom property.
Also it seems like that the description is not saved.
When I look at the schema definition, there are also the properties for description and predefinedName missing:
Expected behavior:
All values are updated correctly. The schema documentation is showing all required fields for the update.
Current behavior is like the following:
Update asset properties works different than updating the list of properties or a predefined property itself.
For the asset -> the key that is sent in the data is matched with the predefined properties in the background. If the key is found in the predefined properties, the name will be set accordingly.
If the key is not found it will get the name "Custom".
The main difference lies in the schemas:
- UpdateDataProperty with key, data, type and inheritable
- UpdatePredefinedProperty with name, description, key, type, data, config, ctype, inheritable
The example request payload does not work with the Asset Update endpoint since it resembles more the UpdatePredefineProperty Schema instead of the UpdateDataProperty.
Currently though it is not possible to update the description of Custom Properties. Maybe we should think about it and then add it to the UpdateDataProperty Schema and asset update endpoint.