Download the PHP package digit-soft/laravel-swagger-generator without Composer

On this page you can find all versions of the php package digit-soft/laravel-swagger-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-swagger-generator

Swagger generator

This package is made to automate API documentation for Swagger (Open Auth 3.0)

Publish config

Usage

To generate doc file (YML) run following command:

To see problems with generation use diagnose mode, where file will not be generated, only helpful information will be printed.

Describing your code

Annotations list

Name Description Places to use
@OA\Response Describes raw response Controller method
@OA\ResponseParam Describes response parameter in Response Inside {} of Response annotation
@OA\ResponseClass Describes response as class object Controller method
@OA\ResponseError Describes error response (shortcut) Controller method
@OA\RequestBody Describes request body FormRequest class
@OA\RequestBodyJson Describes request body with application\json content type FormRequest class
@OA\RequestParam Describes request body parameter Used as argument in @OA\RequestBody annotation
@OA\RequestParamArray Describes request body parameter. Shortcut for array type parameter Used as argument in @OA\RequestBody annotation
@OA\Parameter Describes route parameter Controller method, Controller class
@OA\Property Describes class property Class used for response
@OA\PropertyIgnore Mark class property as ignored Class used for response
@OA\Secured Describes route as secured Controller method
@OA\Tag Describes route tags Controller method, Controller class
@OA\Ignore Marks whole controller or it's action as ignored Controller method, Controller class
@OA\Symlink Describes symlink to another class Class used for response

Responses

Responses are parsed only if explicitly documented by @Annotation. It must be placed in PHPDoc of controller method that route use. RAW response:

JSON RAW response:

or

Response from class properties:

In example above response data will be parsed from App\User PHPDoc.

  1. @property descriptions (property name, type and description)
  2. @property-read descriptions (if set with property in ResponseClass annotation)
  3. @OA\Property annotations (property name, type, description, example etc.)

@OA\ResponseClass use cases, first is standard use but with additional properties

As items list

As paged items list

Error responses

Request bodies

Request data is parsed from ::rules() method of FormRequest class, that used in controller method for the route and it's annotations (@OA\RequestBody, @OA\RequestBodyJson, @OA\RequestParam). From ::rules() method we can obtain only name and type of parameter and suggest some example, but if you want fully describe parameters of request body you must place appropriate annotations in FormRequest class for route.

Examples

Tags

Tags can be defined in Controller class or method that route uses. Do not use space ` in tag names, link with such tag name will be broken in Swagger UI, so better idea to use dash-or underscore_, or even just aCamelCased` tag names. Tags defined in controller will be applied to ALL controller methods.

Secured

This annotation is used to mark route as secured, and tells to swagger, that you must provide valid user credentials to access this route. Place it in controller method.

Property

@OA\Property annotation is used to describe class properties as an alternative or addition to PHPDoc @property. You can place example of property (if property is an associative array for example) or fully describe property if you dont want to place @property declaration for it.

PropertyIgnore

@OA\PropertyIgnore annotation is used to remove given property from object description.

Symlink

This annotation can be used to describe symlink to another class (e.g. for response). All data in class PHPDoc in which it appears will be ignored.

You must use full namespace of annotations, e.g. OA\Property.

Besides, you can import a namespace for better code completion as in example beyond.

More

There is abstract annotation class OA\DescriptionExtender, you can use it for your own annotations, those must add some information to route's description.

Example is bellow.

You can use annotation from example:

and it will add following text into route's description


All versions of laravel-swagger-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^7.30.6||^8.75||^9.1.9||^10.0
symfony/yaml Version ^6.1
phpdocumentor/reflection-docblock Version ^4.3|^5.0
doctrine/annotations Version ^1.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package digit-soft/laravel-swagger-generator contains the following files

Loading the files please wait ....