neondigital/openapi-spec-generator

Creates Open API spec for a Laravel JSON:API

dev-master 2021-04-29 21:48 UTC

This package is auto-updated.

Last update: 2024-10-29 06:30:57 UTC


README

Designed to work with Laravel JSON:API

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

TODO

  • Command to generate to storage folder
  • Get basic test suite running with GitHub Actions
  • Add extra operation descriptons via config
  • Add in tags & x-tagGroups (via config)
  • Consider ->readonly() etc in routes
  • Remove links in payload data when saving resources
  • Fix includes and relations
  • Tidy up the code!!
  • Add tests

🙏 Based upon initial prototype by martianatwork

Usage

Install package

composer install neondigital/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

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