2017 © Pedro Peláez
 

yii2-extension yii2-swaggerviewer

Swagger viewer for multi-document yaml specs

image

justcoded/yii2-swaggerviewer

Swagger viewer for multi-document yaml specs

  • Friday, May 11, 2018
  • by justcoded
  • Repository
  • 3 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

Yii2 Swagger Viewer Module

Viewer of a separate yaml/json swagger docs. Include swagger multi-doc merger, so you can format your docs in multiple files for faster edits., (*1)

This package is based on our SwaggerTools pack., (*2)

Example of docs to view can be found here: SwaggerTools docs example, (*3)

As extra feature, you can provide additional properties to generate enums, which are usually used by mock servers to generate test responses. We recommend Prism mock server. If you specify correct validation rules (like minimum, maximum, minItems, maxItems, etc.) it will generate nice mocks with data generated by faker php lib., (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

php composer.phar require --prefer-dist justcoded/yii2-swaggerviewer "*"

or add, (*7)

"justcoded/yii2-swaggerviewer": "*"

to the require section of your composer.json file., (*8)

Configuration

Add module to your web config file:, (*9)

    'modules' => [
        'swagger' => [
            'class' => \justcoded\yii2\swaggerviewer\Module::class,
            'docsPath' => '@app/docs/swagger/swagger.yaml',

            // use merger tool. if you have single file - can turn it off for faster load.
            'multiDoc' => true,

            // enable faker tool. additional link will be provided to download fakered copy.
            'fakerCopy' => true,
            'fakerNum'  => 10, // number of items to generate
        ],
    ],

The Versions

11/05 2018

dev-master

9999999-dev

Swagger viewer for multi-document yaml specs

  Sources   Download

MIT

The Requires

 

extension yii2 swagger yaml swagger-merger