Things
In the new implementation, Thing can now belong to one, many, or no Category.
The following parameters are no longer returned on a Thing response body: collection, space and credentials.
New attributes have been added to the body of Things:
- Categories
- This attribute replaces the Collection attribute from the old AnythingDB, and it indicates how many Categories the Thing belongs to. It could be from none to many (optional).
- @type
- It can be a string or a slice of string (optional).
- @context
- It can be a string or a slice of string (optional).
- client_id
- This attribute replaces the Credentials attribute from the old AnythingDB; it returns a string with the http client_id of the Thing (only on Things response body).
- status
- Since the Things-Status API is going to be deprecated, this attribute will be introduced in the Things API to still be able to access the latest Property values.
Thing's Behaviour with Models and Categories
If a Thing has a Model
assigned, the Thing schema must match all Model parameters.
As Things can now belong to one, many or none Categories one of these Categories has a Model assigned, the Thing must match that Model to be able to belong to that Category.
In addition, in the new AnythingDB Categories have validators, so Thing must meet these validations to belong to that Category.