Closed CGuether closed 8 months ago
The implementation is complete. Here is the list of blacklisted keys: 'c8y_Notes', 'c8y_IsAssetProperty', 'c8y_JsonSchema', 'c8y_IsAssetType', 'c8y_IsAsset', 'c8y_IsDeviceGroup', 'c8y_Global', 'c8y_Position', 'additionParents', 'assetParents', 'allowedAssetTypes', 'id', 'icon', 'category', 'name', 'isNoneChildAssetsAllowed', 'properties', 'childAdditions', 'childAssets', 'childDevices', 'creationTime', 'description', 'deviceParents', 'label', 'lastUpdated', 'owner', 'self', 'type', 'customProperties', 'pagination', 'currentPage', 'nextPage', 'pageSize', 'key', 'assetModels', 'depth', 'assetProperties', 'tags'
If a user defines a custom property he is free to decide how to name it and what key should be used. The key is used as property name in the data model of the asset, which is created based on this custom property. As there aren't any limitations to what keys the user can define, he could use keys, which are already used as built-in properties. This can result in strange side effects.
For example if the user defines a custom property, which has the key
type
, he could by accident override the built-in property type, which is used to identify the asset type. There should be a blacklist, which contains keys, which must not be used by users and are marked as built-in.