2017 © Pedro Peláez
 

library laravel-apispec-generator

RestAPI spec generator with Laravel test

image

kotamat/laravel-apispec-generator

RestAPI spec generator with Laravel test

  • Wednesday, January 3, 2018
  • by kotamat
  • Repository
  • 1 Watchers
  • 2 Stars
  • 95 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 61 % Grown

The README.md

Laravel API Spec Generator

API Spec generator with Laravel test, (*1)

This Package overrides json() When you use those function, API specs are going to be generated., (*2)

You can select spec below,, (*3)

  • Rest
  • OpenAPI Specification

Usage

Output each specs

Just use ApiSpec\ApiSpecTestCase as base class for API-based test classes., (*4)

+use ApiSpec\ApiSpecTestCase;

class SomeTestCase extends ApiSpecTestCase
{

or use trait ApiSpec\ApiSpecOutput, (*5)

+use ApiSpec\ApiSpecOutput;

class SomeTestCase extends TestCase
{
    +use ApiSpecOutput;
    //...
}

Aggregate output files

After Output each specs, this command aggregates all specs in one file. (only supports OAS mode), (*6)

php artisan apispec:aggregate

Configurations

This package provides config file as apispec.php, (*7)

return [
     // Whether to output spec files.
    'isExportSpec' => true,

     // Spec builder class name. You can choose ToOAS or ToHTTP.
    'builder'      => \ApiSpec\Builders\ToOAS::class,
];

Output

Rest

The output format is recognized on several IDE., (*8)

ex) PHPStorm, IntelliJ IDEA...(2017.3 EAP https://blog.jetbrains.com/phpstorm/2017/09/editor-based-rest-client/, (*9)

OAS

The output format is OpenAPI 3.0.0, (*10)

Restrictions are below, (*11)

  • Security Scheme type supports only JWT
  • All request body contents have required flag
  • Some parameters hard coded.

The Versions

03/01 2018

dev-master

9999999-dev

RestAPI spec generator with Laravel test

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar kotamat

03/01 2018

0.0.1

0.0.1.0

RestAPI spec generator with Laravel test

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar kotamat

03/01 2018

dev-fix-bugs

dev-fix-bugs

RestAPI spec generator with Laravel test

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar kotamat

03/01 2018

dev-kotamat

dev-kotamat

RestAPI spec generator with Laravel test

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar kotamat