Download the PHP package harmbandstra/swagger-ui-bundle without Composer

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

Build Status Code Coverage

Swagger UI Bundle

Expose swagger-ui inside your symfony project through a route (eg. /docs), just like nelmio api docs, without the need for node.

Just add a reference to your OpenAPI Yaml or JSON specification, and enjoy swagger-ui in all it's glory.

After installation and configuration, just start your local webserver, and navigate to /docs or /docs/my_swagger_spec.yml.

Compatibility

NOTE Since version 3.1, support for symfony 4 on the 3.x branch has been dropped. Use the 4.x branch instead.

Installation

Install with composer in dev environment:

$ composer require harmbandstra/swagger-ui-bundle --dev

Make sure swagger-ui assets are copied to web/bundles by adding the Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets hook in your composer.json.

If the scripts section in composer.json looks like this (symfony 4):

Add the composer hook like this:

Enable bundle in app/AppKernel.php(Symfony 3):

Enable bundle in config/bundles.php(Symfony 4):

Add the route where swagger-ui will be available in routing_dev.yml:

Configuration (Symfony 3)

In your config.yml, link to the swagger spec.

Specify the directory where your swagger files reside. You can access multiple files through the endpoint like /docs/my_swagger_spec.json. Under files you specify which files should be exposed.

The first file in the array is the default one and it will be the file the /docs endpoint will redirect to. For this file you have the option to specify an absolute path to the .json spec file ("/_swagger/swagger.json") or a URL ("https://example.com/swagger.json").

Optional: If you want to have a default configuration in place for Swagger UI, place a config.json in the same directory as the swagger files, and add it to the configuration. It will be loaded automatically by appending it as the query parameter configUrl.

Optional: If you serve your project from a different directory than the vhost root, you can overwrite the asset URL path with the assetUrlPath configuration. Be sure to add a leading and trailing slash.

Configuration (Symfony 4, 5 and 6)

Create a file hb_swagger_ui.yaml in config/packages. Follow the rest of the steps for configuration in Symfony 3.


All versions of swagger-ui-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
symfony/config Version ^4.4|^5.0|^6.0
symfony/dependency-injection Version ^4.4|^5.0|^6.0
symfony/framework-bundle Version ^4.4|^5.0|^6.0
symfony/http-kernel Version ^4.4|^5.0|^6.0
symfony/routing Version ^4.4|^5.0|^6.0
symfony/yaml Version ^4.4|^5.0|^6.0
swagger-api/swagger-ui Version 4.1.2
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 harmbandstra/swagger-ui-bundle contains the following files

Loading the files please wait ....