chariot-dev / chariot

IoT Sensor Framework
GNU Lesser General Public License v3.0
5 stars 4 forks source link

Modify Json Response #48

Open hojohn2561 opened 4 years ago

hojohn2561 commented 4 years ago

http://localhost:5000/chariot/api/v1.0/network/device

Can you in addition, make this response return an alias to each of the fields. Would make it easier to display human-readable strings on the front end. Currently have to hardcode. image image

enioluwas commented 4 years ago

Not sure if there is an endpoint for this but on the back end, there is a method to get device info, and this returns aliases that are human-readable.

Perhaps two requests (not ideal but would work), the first to get the device info and populate the fields, and the second to get the actual field values, would work. The device info also includes other useful information like input type (number, string, etc) and validation regex (currently not implemented yet though).