Web Services API handling design issues
|Reported by:||srokap||Owned by:|
|Priority:||normal||Milestone:||Long Term Discussion|
Actually there are three thing's in current REST API implementation that are badly designed to say the least:
- Optional parameters handling.
Imagine i have function 'test' getting param1 and param2, both optional. And handler function handler($a, $b).
We expect that value passed as param2 will end up always in parameter $b. But it depends on it if we provide param1 or not! If we provide param1, the value of param2 is passed as $b, if we don't it'll end up in $a...
I can't imagine how such behaviour could be expected one...
- Function serialise_parameters breaks nested arrays, as it casts array items to string... Example:
¶m2=123¶m3=qwe¶m3=fdasis read as
Array (  => qwe  => )
Where it should be:
Array (  => qwe  => Array (  => fdas ) )
- We require to register only global functions as rest handlers, and use eval with parameters serialized to string (sic!). I really don't see why don't we serialize parameters preserving it's structure, and pass it to function using call_user_func_array? It would even allow callback in array(class, method) format.
Change History (4)
comment:3 Changed 12 months ago by ewinslow
- Milestone changed from Needs Review to Long Term Discussion