php - Hide Restler method from swagger-ui -


using restler 3.0.0-rc6, internally packages swagger-ui, have api method defined so:

<?php  namespace v1:  class postgresql {     public function fetcharray($sql, $args = null) { 

and of classes include via restler's addapiclass extend postgresql class. means when swagger runs, every single api shows fetcharray function. i'd have method not appear in swagger documentation it's not part of api. other 'things' on website use class though can't change modifier public.

what's proper syntax hide method swagger-ui's webpage?

there 2 ways achieve this,

one mark fetcharray method private @access private comment. remove fetcharray api urls while keeping fetcharray still accessible php

problem in case don't want modify postgresql part of framework maintained composer. instead of directly extending base class use intermediary class adds comment , extend class shown below

class base {     public function fetcharray(){         return array();     } }  class intermediary extends base {     /**      * @access private      */     public function fetcharray(){         return array();     } }  class myapi extends intermediary { //instead of extends base     //other api methods here     //see in explorer note fetcharray no longer listed } 

another way exclude on explorer with

use luracast\restler\explorer; explorer::$excludedpaths = array('myapi/fetcharray','another/fetcharray'); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -