Declare typed route parameters in an action
An action can describe the parameters it expects with params, using the same type names as input. UIDs are generated with UID() and include a checksum, so an arbitrary string is not a valid UID. When a parameter does not match its type, the framework answers with a validation error and your action function is not called.
NEWACTION('Items/read', {
name: 'Read an item',
params: 'id:UID',
action: function($) {
$.success($.params.id);
}
});exports.install = function() {
ROUTE('GET /items/{id}/ --> *Items/read');
};