So what exactly changed?
To be honest, nothing you can really see. The frontend and mesh-network now support RESTv4, which increased the speed up to 100%.
In other news /responsible/ got removed and / added. The new path now returns a JSON object full of every endpoint and the possible data you can input. That's a quite important and visible addition to the REST-API. /discover now no longer uses a PUT request for execution but rather a POST boolean input called execute. The attribute dict is now also deprecated and should not be used anymore.
Also in the backend of the backend (REST-API), an own input verification system got added, that proves if the correct data got inserted and converts the data if possible and necessary. The new verification system uses the following syntax to gather the data:
{'name': STRING, 'type': TYPE, 'fallback': STRING, 'restricted': [STRING, {'name': STRING, 'fallback': STRING}], 'list': BOOLEAN}
A small explanation:- name is the name of the selected argument
- type is the target type of the argument, like str, bool, int or float
- fallback is used if the argumentis not present or a non-valid value
- restricted is a list of all possible values, if a value referes to another it is a string with a name and fallback
- list is a boolean indicating if chaining should be done
Also, the select statement now supports chaining. So you can now query for multiple things at once, in just one request. It get's returned as an object, where each item in select is a key. Here's an example:
Example request GET arguments:
?select=created_at,timestamp
Example input verification output:{"select": ["created_at", "timestamp"]}
Example return output:{'created_at': DATA, 'timestamp': DATA}
REST v4.2 will remove REST v3 and include a write only test case
Have a nice day
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.