PHP code example of widmogrod / zf2-rest-api-documentator

1. Go to this page and download the library: Download widmogrod/zf2-rest-api-documentator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

widmogrod / zf2-rest-api-documentator example snippets



return array(
    // Configuration namespace within this module looking for data
	'zf2-rest-api-documentator' => array(
	    // Contains collection of documentation descriptions.
        'docs' => array(
            // Namespace of module within REST API description resides. Must be unique per module.
            'my_module_name' => array(
                'name' => 'api.example.com',
                'version' => '1.1',
                'baseUrl' => 'http://127.0.0.1:8080/api',
                // Strategy is way, in which this configuration will be interpreted.
                'strategy' => 'standard',
                // General description for common thing in module, to skip redundancy
                'general' => array(
                    'params' => array(
                        'id' => array(
                            'type' => 'integer',
                            '        'body' => array(
                            'type' => 'WidRestApiDocumentator\Body\JsonBody',
                            'params' => array(
                                'name' => array(
                                    'type' => 'string',
                                    '               ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
	),
);

 php
return array(
	'zf2-rest-api-documentator' => array(
        'strategies' => array(
            'invokables' => array(
                'myStrategy' => 'WidRestApiDocumentator\Strategy\Standard',
))));
 php

chdir(__DIR__);
if (!is_dir('public/assets')) {
    mkdir('public/assets', 0777, true);
}

$config = array(
    'modules' => array(
        'AsseticBundle',
        'WidRestApiDocumentator',
    ),
    'module_listener_options' => array(
        'config_glob_paths'    => array(
            'tests/config/autoload/{,*.}{global,local}.php',
        ),
        'config_static_paths' => array(
            'tests/config/autoload/assets.php',
            'config/api.config.php',
        ),
        'module_paths' => array(
            'WidRestApiDocumentator' => __DIR__
        ),
    ),
);