Skip to content

openclerk/api-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openclerk/api-list Build Status

A library for listing and discovering runtime properties of APIs

Installing

Include openclerk/api-list as a requirement in your project composer.json, and run composer update to install it into your project:

{
  "require": {
    "openclerk/api-list": "dev-master"
  }
}

Using

If you are using something like component-discovery, you can define a new API for listing all runtime discovered APIs using the ApiListApi abstract superclass:

class MyApiListApi extends \Apis\ApiList\ApiListApi {

  function getAPIs() {
    return \DiscoveredComponents\Apis::getAllInstances();
  }

}

You can also get all runtime API information like so:

$lister = new \Apis\ApiList\ApiLister();
$apis = $lister->processAPIs(\DiscoveredComponents\Apis::getAllInstances());

foreach ($apis as $api) {
  print_r(array(
    $api['endpoint'],
    $api['title'],
    $api['description'],
    $api['params'],   // array
    // ...
  ));
}

About

A library for listing and discovering runtime properties of APIs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages