Error on duplicate object_id
Closed this issue · 5 comments
Is your feature request related to a problem? Please describe.
If a device as two attrs with the same object_id, fiware would randomly send the value to only one attr.
Describe the solution you'd like
Warn / throw errors in that case for a device-config.
Good points! However, regarding the latest function that iotagent provides check here, I would even suggest that the name
of attrs can be duplicated but the object_id
must be unique
@djs0109 Yes, that is correct. The final decision maker is always the object_id
. This is also used in the expression language FIWARE provides. The name is just lovely to have for the user. In the database, I think name
is even copied to opject_id
if omitted.
I would suggest that a device request checks if the object_id
is already taken. Hence, for a complete update of the device, the model can check for it, and partial updates would require getting the whole device config first.
However, @FWuellhorst Are you sure that the IoT-Agent is not checking on this in the current version?
Branch 178-Error-on-duplicate-object_id created!
Refactor plan:
- Not require
object_id
- If
object_id
is given, it should be unique - Device attribute
name
must not be unique