Restler-API-Explorer icon indicating copy to clipboard operation
Restler-API-Explorer copied to clipboard

Explorer not showing when using useUrlBasedVersioning and AuthenitcationClass - 200 : OK ../resources.json

Open codemonkeyneo opened this issue 10 years ago • 2 comments

This one is driving me nuts and maybe its just me, but at least I can recreate the issue.

Explorer is giving me the following error;

200 : OK ../resources.json

I have worked out that its because of Authenitcation class and set useUrlBasedVersioning both included in the index.php. If you try each of the items separately then explorer works as expected. I do want both to work so I can show both versions in explorer.

Code used

Defaults::$useUrlBasedVersioning = true;  // comment out to work and leave auth line

$r = new Restler();
$r->setAPIVersion(2);
$r->setSupportedFormats('JsonFormat', 'XmlFormat');

$r->addApiClass('Resources'); // this produces the needed resources.json

$r->addAPIClass('BMI');
$r->addAuthenticationClass('SimpleAuth'); // comment out to work and leave url line
$r->handle();

is this a bug or does it need to be refactored differently.

Cheer

Codemonkeyneo

codemonkeyneo avatar Feb 24 '15 12:02 codemonkeyneo

Thanks for giving some sample code which will make it easy to reproduce the error, will check it ASAP

Arul- avatar Feb 24 '15 12:02 Arul-

Possible solved my issue but not sure its correct way.

I have had to add the SimpleAuth class into a seperate version folder.... guess this could get messy ?

Is it possible to just have one auth class for all versions ?

codemonkeyneo avatar Feb 24 '15 12:02 codemonkeyneo