Skip to content

Connect to your existing application with OpenApi 3.0 markup and generate Swagger documentation on the fly. If this tool is useful to you, then you can thank us by putting the repository ⭐

License

Notifications You must be signed in to change notification settings

pantera-digital/yii2-swagger-your-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger your app

This small application allows you to connect to your another existing application in which you use OpenApi 3.0 markup and generate Swagger documentation on the fly.

Yii2 is used as a microframework.

genxoft/yii2-oas3 package is used as a yii2-wrapper for php-swagger.

Install

git clone https://github.com/pantera-digital/yii2-swagger-your-app.git
composer install

Configure

In config.php your should specify paths to parse your code:

    'params' => [
        'apiPathsToParse' => [
            // 'C:/xampp/htdocs/your-project/controllers',
            // 'C:/xampp/htdocs/your-project/models',
            // or
            // '/var/www/your-project/controllers',
            // '/var/www/your-project/models',
            // etc.
        ]
    ]

CORS

If you use swagger on a domain other than your API, you must allow access based on Cross-origin resource sharing (CORS):

Access-Control-Allow-Origin: "*"
Access-Control-Expose-Headers: ""

Run

Navigate your browser to path like http://localhost/yii2-swagger-your-app/web You will see similar:

About

Connect to your existing application with OpenApi 3.0 markup and generate Swagger documentation on the fly. If this tool is useful to you, then you can thank us by putting the repository ⭐

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages