Fixes #5778: correct API with JSON parameters for directives creation&up...

shouldn't you explain which one a bad value for parameter ?