Mentions légales du service

Skip to content

Switch should also fully specify return values

Created by: stephanemagnenat

Currently, the Switch defines, using JSON schemas, input values as these are used to check for the validity of the data. For instance, when creating a constant, its value is checked against the range of validity (-32768:32767) and its name according to Aseba constraints (for instance its name cannot start with a digit).

For the sake of completeness, the return types should also be fully defined. A clean way to do this is to specify a JSON schema in HttpDispatcher::definitions in HttpDispatcher.cpp for each kind of return type. These generic schemas could then be referenced for specifying the content of the incoming and outgoing data.