Download the PHP package draw/open-api-bundle without Composer

On this page you can find all versions of the php package draw/open-api-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 open-api-bundle

Draw Open Api Bundle

Integration for draw/open-api into symfony 4 bundle

The first objective is to be able to generate a Open Api v2 documentation with minimum effort by the programmer. The draw/open-api provide a multitude of extractor to get the information where it can (PHP for example).

The integration with symfony allow you to use most of the Draw\Component\OpenApi\Schema (alias @OpenApi) as annotation above your controller method to document them.

The bundle also provide some tools to provide a rest api without the need of FOSRestBundle.

Sandbox

To install the sandbox you can run

The first argument is the version to install (E.g.: v3.52.5). By default it master.

We recommend that you add this to your composer.json scripts section before the asset:install

Configuration

Here is a example of the configuration:

Controller documentation

To document a controller for Open Api you must use the @OpenApi\Tag or @OpenApi\Operation annotations.

If you plan to use the Open Api codegen we recommend using the @OpenApi\Operation since it will give you control over the operationId, otherwise it will use the route name.

Query Parameters

If you want to inject configured query parameters in a controller you must set the convertQueryParameterToAttribute to true in the configuration.

`

You must also add the annotation Draw\Component\OpenApi\Schema\QueryParameter to your controller. This will provide the documentation information for Open Api and also configure which query parameters should be injected.

View

To allow the automatic serialization of response you must active it:

`

The will detect if the return value of your controller is not a response and will serialized it according to the Draw\Bundle\OpenApiBundle\Response\Serialization annotation.

By default if there is not annotation the serializer context will not have any value and the response will be 200. Using the view allow to override the serializer groups and version, the status code of the response. The Serialization annotation is also use for the Open Api documentation, the headers attribute is use for that.

If your controller return null the status code will be set to 204 by default (not content).

The Draw\Bundle\OpenApiBundle\Response\Serialization implement Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface with a alias draw_open_api_serialization .

Instead of putting a serializerVersion on each header you can create a listener that will set the version base on something else. Here is a example of a listener that will take from the url path /api/v{number}/....:


All versions of open-api-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
ext-json Version *
doctrine/annotations Version ^1.11
draw/open-api Version ^0.7.59
jms/serializer-bundle Version ^3.7
symfony/framework-bundle Version ^4.4 || ^5.4
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 draw/open-api-bundle contains the following files

Loading the files please wait ....