Download the PHP package zircote/swagger-php without Composer

On this page you can find all versions of the php package zircote/swagger-php. 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?
zircote/swagger-php
Rate from 1 - 5
Rated 4.86 based on 37 reviews

Informations about the package swagger-php

Build Status Total Downloads

swagger-php

Generate interactive OpenAPI documentation for your RESTful API using PHP attributes (preferred) or doctrine annotations (requires additional doctrine/annotations library).

See the documentation website for supported attributes and annotations.

Annotations are deprecated and may be removed in a future release of swagger-php.

Features

OpenAPI version support

swagger-php can generate specs for OpenAPI 3.0.0, OpenAPI 3.1.0 and OpenAPI 3.2.0. Classic mode defaults to 3.0.0, spec and hybrid mode to 3.1.0.

The command line option --version selects a different version; programmatically, use Builder::setVersion().

Requirements

swagger-php requires at least PHP 8.2.

Installation (with Composer)

For cli usage from anywhere, install swagger-php globally and add Composer's global binary directory (composer global config bin-dir --absolute) to your PATH, so the openapi executable can be located by your system.

doctrine/annotations

As of version 4.8 the doctrine annotations library is optional and no longer installed by default.

If your code uses doctrine annotations you will need to install that library manually:

Usage

Use OpenAPI attributes to add metadata to your classes, methods and other structural PHP elements.

Visit the Documentation website for the Getting started guide or look at the examples directory for more examples.

🧪 Spec Attributes (Beta)

Available since 6.5.0

The attribute API is frozen. The beta label stays until v7, because the documents spec mode generates may still change until then.

A new processing mode using typed attributes from the OpenApi\Spec namespace:

Hybrid mode works with your existing OpenApi\Attributes code, with no changes needed. It runs the classic scanner but uses the new augmenter pipeline and version-aware compilers, which are easier to extend. Switching to hybrid is also the easiest way to help test the new pipeline:

Or from the CLI: ./vendor/bin/openapi src/ --mode hybrid

See the Spec Attributes guide and Processing Modes for full documentation.

Usage from PHP

Generate always-up-to-date documentation.

Builder is the stable entry point for every mode, and one instance builds one document. See the Builder reference for its API.

Details on how to generate OpenApi specifications can be found in the generate reference.

Usage from the Command Line Interface

The openapi command line interface can be used to generate the documentation to a static yaml/json file.

Automatic type resolution

As of version 6, resolving of types is done using the TypeInfoTypeResolver class. It uses the symfony/type-info library under the hood which allows handling of complex types.

With this change, swagger-php supports all available native type-hints and also complex generic type-hints via phpdoc blocks. This simplifies the definition of schemas.

For example, the following two examples are now equivalent:

If this is not desired, the LegacyTypeResolver can be used to preserve the old behaviour of version 5. The LegacyTypeResolver is deprecated and will be removed in a future release.

Contributing

More on OpenApi & Swagger


All versions of swagger-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
nikic/php-parser Version ^4.19 || ^5.0
phpstan/phpdoc-parser Version ^2.0
psr/log Version ^1.1 || ^2.0 || ^3.0
radebatz/type-info-extras Version ^1.0.2
symfony/console Version ^6.4 || ^7.0 || ^8.0
symfony/deprecation-contracts Version ^2 || ^3
symfony/finder Version ^5.0 || ^6.0 || ^7.0 || ^8.0
symfony/yaml Version ^5.4 || ^6.0 || ^7.0 || ^8.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 zircote/swagger-php contains the following files

Loading the files please wait ...