Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API
I have this:
$restler->addAuthenticationClass('\\Tuleap\\REST\\TokenAuthentication');
$restler->addAuthenticationClass('\\Tuleap\\REST\\BasicAuthAuthentication');
Is there a way to say to Restler that if TokenAuthentication fails it has to fallback to the next authentication class? Or do I have to do a mixed authentication class that deals with the two authentication types?
this is my controller file under app/controller Lorem.php
<?php
class Lorem {
function index(){
return 'aaa';
}
}
here is my public/index.php
use Luracast\Restler\Restler;
$r = new Restler();
$r->addApiClass('Lorem');
$r->addAPIClass('Resources');
@Arul- can you please tell me the steps am new in git system ..
What am doing is
change index.php fileuse Luracast\Restler\Restler;
$r = new Restler();
//$r->setSupportedFormats('JsonFormat', 'XmlFormat');
$r->addApiClass('Pet');
//$r->addApiClass('ApiDocs');
$r->addAPIClass('Luracast\\Restler\\Explorer');
what about changes in explorer/index.html
``$(function () {
window.swaggerUi = new SwaggerUi({
discoveryUrl:"../resources.json",
apiKey:"",
dom_id:"swagger-ui-container",
supportHeaderParams: false,
supportedSubmitMethods: ['get', 'post', 'put', 'patch', 'delete'],
onComplete: function(swaggerApi, swaggerUi){
if(console) {
console.log("Loaded SwaggerUI")
console.log(swaggerApi);
console.log(swaggerUi);
}
},
onFailure: function(data) {
if(console) {
console.log("Unable to Load SwaggerUI");
console.log(data);
}
},
docExpansion: "none"
});
window.swaggerUi.load();
});``
is it still work for resources.json ??