定制 appointer/swaggervel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

appointer/swaggervel

最新稳定版本:v2.5

Composer 安装命令:

composer require appointer/swaggervel

包简介

A great way to integrate Swagger into Laravel

README 文档

README

This package combines Swagger-php and swagger-ui into one Laravel-friendly package. When you run your app in debug mode, Swaggervel will scan your app folder (or any folder that is set under the "app-dir" variable in the packages config), generate swagger json files and deposit them to the doc-dir folder (default is /docs). Files are then served by swagger-ui under the api-docs director.

Installation

  • Execute composer require appointer/swaggervel --dev within your laravel root directory
  • Add Appointer\Swaggervel\SwaggervelServiceProvider::class to your providers array in app/config/app.php above your route provider, to avoid any catch-all routes
  • Run php artisan vendor:publish --tag=public to push swagger-ui to your public folder (can be found in public/vendor/swaggervel).
  • Optionally run php artisan vendor:publish --tag=config to push the swaggervel default config into your application's config directory.
  • Optionally run php artisan vendor:publish --tag=views to push the swaggervel index view file into resources/views/vendor/swaggervel.

Examples (when using the default configuration)

Options

All options are well commented within the swaggervel.php config file.

How to Use Swagger-php

The actual Swagger spec is beyond the scope of this package. All Swaggervel does is package up swagger-php and swagger-ui in a Laravel-friendly fashion, and tries to make it easy to serve. For info on how to use swagger-php look here. For good examples of swagger-php in action look here.

Further Notes

This package is a fork of slampenny/Swaggervel, as it is no longer maintained.

TODO

  • the handling of the /doc call is still really inconsistent, as you cannot change the file name (api-docs.json), but are able to change the file you acces when using the /doc route.

统计信息

  • 总下载量: 306.9k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 65
  • 点击次数: 1
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 65
  • Watchers: 8
  • Forks: 156
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-21