byteit/openapi-spec-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

byteit/openapi-spec-generator

Composer 安装命令:

composer require byteit/openapi-spec-generator

包简介

Creates Open API spec for a Laravel JSON:API

README 文档

README

Designed to work with Laravel JSON:API

!!! Disclaimer: this project is work in progress and likely contains many bugs, etc !!!

What it can and can't

Can

  • Generate Schemas/Responses/Request/Errors for all default Laravel JSON:API routes
  • Use a seeded database to generate examples

Can't yet

  • Customisation of the generation
  • Generation for custom actions
  • Generation for custom filters
  • Generation for anything custom
  • Generation for MorphTo relations (MorphToMany works)
  • Generation of Pagination Meta
  • Generation of Includes
  • Generation of Authentication/Authorization

TODO

  • Command to generate to storage folder
  • Get basic test suite running with GitHub Actions
  • Add extra operation descriptions via config
  • Add in tags & x-tagGroups (via config)
  • Add tests (Use the dummy by laraveljsonapi to integrate all features)
  • Add custom actions
  • Split schemas/requests/responses by action
  • Consider field attributes
    • bool readonly
    • bool hidden
    • closure based readonly (create/update)
    • closure based hidden
  • List sortable fields
  • Fix includes and relations
    • Add relationship routes
    • Add includes
  • Add authentication
  • Add custom queries/filters
  • Add a way to document custom actions
  • Tidy up the code!!
  • Replace cebe/php-openapi with goldspecdigital/oooas
  • Move to an architecture inspired by vyuldashev/laravel-openapi
  • Use php8 attributes on actions/classes to generate custom docs

🙏 Based upon initial prototype by martianatwork and glennjacobs

Usage

Install package

composer require byteit/openapi-spec-generator

Publish the config file

php artisan vendor:publish --provider="LaravelJsonApi\OpenApiSpec\OpenApiServiceProvider"

Generate the Open API spec

php artisan jsonapi:openapi:generate v1

Note that a seeded DB is required! The seeded data will be used to generate Samples.

Generating Documentation

A quick way to preview your documentation is to use Speccy. Ensure you have installed Speccy globally and then you can use the following command.

speccy serve storage/app/v1_openapi.yaml

统计信息

  • 总下载量: 1.11k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-06-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固