Download the PHP package amsify42/php-swagger-postman without Composer
On this page you can find all versions of the php package amsify42/php-swagger-postman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amsify42/php-swagger-postman
More information about amsify42/php-swagger-postman
Files in amsify42/php-swagger-postman
Package php-swagger-postman
Short Description PHP package for generating swagger json through its annotation and generate postman collection from it
License MIT
Informations about the package php-swagger-postman
PHP Swagger Postman
For generating enpoint specific Attribute, you can call this method
You can also pass parameter rules and route params also with key value pair to get it added to the attribute
For generating response data in attibute
You can also pass callback for checking rules and decide the param needs to have TinyInt or Enum Values or Custom Property Attribute
By default NULL
needs to be return if array of tinyint/enum/property is not return and if you want to generate property for a param which might be having simple or nested array
For adding security
Example security attribute already added
For adding header with static value
For adding response which already defined
Example Validation already defined
For generating Annotation instead of Attribute
Notes:
- You can use all the method with Annotation which is mentioned above for Attribute but Attribute requires minimum php
8.2
version. - For using Annotation with latest
swagger-php
installed, you may have to separately installdoctrine/annotations
Refer to this link for more details https://github.com/zircote/swagger-php/blob/master/docs/guide/migrating-to-v4.md
Scanning the directory and generating swagger json for API documentation and postman collection and postman environment json.
Notes:
- Make sure to have
OA/Info
and at least one API endpoint already added before running$swagger->getGeneratedJson()
method. - For detecting source classes properly while scanning the directory, Either set
autoload
incomposer.json
or usespl_autoload_register()
method for customize autoloading of the classes.
Annotation Example
If you want postman environment to have baseURL variable value, you can either set like this
or define at least one server in Attribute
or in Annotation
for adding environment suffix in postman environment file name, you can pass it in second parameter of Swagger Constructor