Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Arul
    @Arul-
    if a function parameter has a default value, and is placed after all the required parameters, it is considered as optional
    Martin Goyot
    @Erwyn
    okay, I take good note, and my last question of the day (sorry for bothering you so much today)
    Arul
    @Arul-
    for some reason if you want to override that, you can set {@required} to mark it as required or {@required false} to mark it as optional. When you force a required parameter as optional that method will receive null for that parameter when omitted by the api user
    Martin Goyot
    @Erwyn
    i Have something like this for a route:
    * @param array  $values    Artifact fields values {@from body} {@type \Tuleap\Tracker\REST\v1\ArtifactPOSTValues}
    Arul
    @Arul-
    ok
    Martin Goyot
    @Erwyn
    and the ArtifactPostValues being something like:
    class ArtifactPOSTValues {
    
        /**
         * @var int {@type int} {@required true}
         */
        public $field_id;
    
        /**
         * @var mixed {@require false}
         */
        public $value;
    }
    Arul
    @Arul-
    ok
    Martin Goyot
    @Erwyn
    on RC4 I would have correctly filled objects, but with the RC6, field_id and value are both null (at least using XML, I'll try with JSON)
    ah, and set {@type mixed} ?
    Arul
    @Arul-
    your definition means that you are expecting an array of ArtifactPOSTValues object
    Martin Goyot
    @Erwyn
    yes
    Arul
    @Arul-
    I haven’t tested it with xml lately but it should work
    Check with JSON and file a bug if not consistent
    it is past mid-night in Singapore (1:20am) Will catch you tomorrow
    Martin Goyot
    @Erwyn
    oh sorry, I'm in France
    Have a good night
    Martin Goyot
    @Erwyn
    So, we'll discuss this tomorow, but it does not work in JSON api neither so they are consistent. It may probably come from something we are doing wrong on our side.
    Martin Goyot
    @Erwyn
    Hello
    The casts works, I made a mistake yesterday, my bad
    Arul
    @Arul-
    oh ok
    Martin Goyot
    @Erwyn
    Hello!
    I have a question regarding authentication classes

    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?

    Arul
    @Arul-
    before the latest RC6 all authentication classes need to return true in order to access the api. Latest RC6 gets it the way you want! it will first try TokenAuthentication, if it fails it will use BasicAuthentication
    Martin Goyot
    @Erwyn
    okay it works, my bad.
    R. Cloeck
    @RemlineNL
    Can someone please let me know where i can find some sort of roadmap or tell me if swagger 2.0 is going to be implemented?
    Arul
    @Arul-
    We are working on swagger 2 implementation already, but hit some road blocks so might take while
    Anas Anjaria
    @anasanjaria
    how can I ?

    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');

    Also I have copied explorer folder from examples & put it in public folder
    When I hit http://localhost/api/public/explorer/index.html it says Forbidden: at least one Authentication Class is required
    & I dont have any method protected
    what am I doing wrong ?
    Please help me
    http://localhost/api/public/lorem works perfectly fine for me
    Arul
    @Arul-
    Will try to reproduce this scenario and get back to you
    Anas Anjaria
    @anasanjaria
    thanks a bunch
    Arul
    @Arul-
    @anasanjaria we are able to re-produce the error, will work on the fix
    Arul
    @Arul-
    @anasanjaria fix has been pushed to RC6. Also make sure you try the new Explorer class instead of Resources class
    Anas Anjaria
    @anasanjaria

    @Arul- can you please tell me the steps am new in git system ..

    What am doing is

    1. updating vendor using composer
    2. change index.php file
      use 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 ??

    Arul
    @Arul-
    here are the exact steps needed
    1. run composer update
    2. change index.php to have $r->addApiClass(‘Explorer’); instead of $r->addApiClass(‘Resources’);
    3. point your browser to {YOUR_API_URL}/explorer/
    This explorer class comes with its on swagger ui
    NOTE:- If your old explorer folder is still at the public folder, remove it
    Try and let me know!
    Anas Anjaria
    @anasanjaria

    I tried to update my code via composer but changes are not reflecting the files like Restler.php & Scope.php . I have checked commits & changes from below URL

    https://github.com/Luracast/Restler-Framework/commits/3.0.0-RC6

    Anas Anjaria
    @anasanjaria
    ok my code is now up to date with that of repo @ github
    now when I type url http://dev.laravel.com/explorer/