swagger-php having different documentations from the same code -
we using slim framework , swagger-php dynamically generate swagger documentation. have special methods in api should not publicly documentated. (/doc now) there way can have second documentation url (/doc2) can secret methods , params documentated? (without having make documentation hand, using annotations in php code). thanks.
as per latest version of swagger-php can indicate list of files and/or directories exclude scanning when building documentation.
see scan function's docblock on github details.
a solution problem separate public , private methods different files. create 2 documentation generation methods/functions each excluding other's files.
example:
$privateoptions = array( 'exclude' => array('app/api/public') ); $privatedoc = swagger\scan("app/", $privateoptions); ... $publicoptions = array( 'exclude' => array('app/api/private') ); $publicdoc = swagger\scan("app/", $publicoptions);
note: example indicative , not tested, can exclude filenames.
Comments
Post a Comment