Opinion on validating REST-XML return values...

Opinion on validating REST-XML return values...

de Jérôme Mouneyrac -
Número de respuestas: 2

Audience: Moodle web service developers

Hi,

at the moment in our web servers if these two conditions are met:
* a return value is set to PARAM_XXXX
* the externallib.php::methodname() return a value not matching PARAM_XXXX

then:
* REST-XML will return the value
* all other servers will throw an exception (invalid_response_exception) 

If you are against validating the REST-XML (it seems we are going into the direction), you are very welcome to give your reason in MDL-29459 or here. This change could break some thirdparty clients that:
a) use thirdparty web services and ...
b) are only using REST and ...
c) expect values not matching the description. (most likely a bug from the web service)

Thank you.

 

Promedio de valoraciones: -
En respuesta a Jérôme Mouneyrac

Re: Opinion on validating REST-XML return values...

de Tim Hunt -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

I think we must be consistent between protocols, and we should validate the return value everywhere.

I think the Moodle 2.x web-service framework is sufficiently new that we are unlikely to break much, and if anything does break, it is better off being detected and fixed, rather than ignored.