Download the PHP package timeinc/swagger-bundle without Composer

On this page you can find all versions of the php package timeinc/swagger-bundle. 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 swagger-bundle

SwaggerBundle

Travis Packagist

This bundle provides integration of swagger-php in Symfony. It should only run in the dev environment, as searching for annotations at runtime is not performant. The bundle comes with the ability to generate a swagger.json file that can be statically served.

Installation

Install via Composer:

Enable Bundle

In your app/AppKernel.php file, add the following to your list of dev bundles:

Configure Bundle

Application Configuration

Open ./app/config/config_dev.yml and add your configuration like below.

The full configuration reference for a comprehensive list of all values and defaults.

Routing

The bundle comes with routes to view the default swagger.json schema or schemas with overridden host, schemes and base_path as defined by your presets. To enable the routes, add the following to your ./app/config/routing_dev.yml:

You can then access your default schema through /_swagger/swagger.json or your alternative schemas through /_swagger/swagger-{alternative-host-name}.json. As noted before, this should not be added to the production routes.

Usage

Once you have registered your bundles under swagger > bundles in config_dev.yml, the swagger-bundle will automatically search for any swagger-php annotations under:

Please see swagger-php's annotation reference for details about swagger-php's syntax.

Symfony Routes

This bundle comes with an extra \TimeInc\SwaggerBundle\Swagger\Annotation\Route annotation that allows you to define a symfony route as a swagger endpoint. using the annotation will set a swagger path for each method and add parameters for the path variables and any defaults as query strings.

The annotation can be defined on a class or a method with the following properies:

Property Context Default Notes
method CLASS The method name to inspect
route CLASS|METHOD The Symfony route to inspect
returns CLASS|METHOD entity The response data type (collection|entity)
entity CLASS|METHOD The entity that is returned. If omitted, will be guessed based on controller name
queryParams CLASS|METHOD [] Any extra query parameters as Key/Value array of queryParameter/dataType
headers CLASS|METHOD [] Any extra header parameters as Key/Value array of headerName/dataType

NOTE: If the entity is omitted, the bundle will search for an entity name of the same name as the controller in the same bundle. For Example, the below example controller is Acme\PetBundle\Controller\PetController, so the bundle will search for an entity in Acme\PetBundle\Entity\Pet

Command Line

You can dump the json schema to the console with the swagger:dump command:

HINT: You can use the option --alternative-host=product to override host, schemes and base_path with your production preset

API Gateway

The bundle can also generate a swagger schema for an AWS API Gateway using the HTTP Proxy.

The schema can then be imported into the AWS console to generate a 1-1 route mapping over a HTTP proxy for your API. All parameters and headers and imported into AWS and passed through.

API Gateway

Please see the docs on how to integrate your API with API Gateway.


All versions of swagger-bundle with dependencies

PHP Build Version
Package Version
Requires zircote/swagger-php Version ~2.0
symfony/symfony Version ^2.7|^3.0
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 timeinc/swagger-bundle contains the following files

Loading the files please wait ....