Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jun 1, 2024 via composer

zircote/swagger-php 4.7.15

swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations
Package summary
Share
0
issues
2
licenses
8
MIT
1
Apache-2.0
Package created
19 Apr 2012
Version published
12 Oct 2023
Maintainers
3
Total deps
9
Direct deps
5
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
8 Packages, Including:
doctrine/annotations@2.0.1
doctrine/lexer@3.0.1
psr/cache@3.0.0
psr/log@3.0.0
symfony/deprecation-contracts@v3.5.0
symfony/finder@v7.1.0
symfony/polyfill-ctype@v1.29.0
symfony/yaml@v7.1.0

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
zircote/swagger-php@4.7.15
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
β“˜ This is a list of zircote/swagger-php 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
doctrine/annotations2.0.138.86 kBMIT
prod
psr/log3.0.06.77 kBMIT
prod
symfony/deprecation-contractsv3.5.0-MIT
prod
symfony/finderv7.1.0-MIT
prod
symfony/yamlv7.1.0-MIT
prod

Visualizations

Frequently Asked Questions

What does zircote/swagger-php do?

The Zircote/Swagger-PHP is a powerful composer package designed for automatic generation of interactive OpenAPI documentation for your RESTful APIs by using PHPDoc annotations. The tool is compatible with OpenAPI 3.0 and 3.1 specifications and is capable of extracting information from code and existing PHPDoc annotations. Zircote/Swagger-PHP is known for its exceptional error reporting and as of PHP 8.1, all its annotations are available as PHP attributes.

How do you use zircote/swagger-php?

To take advantage of Zircote/Swagger-PHP in your project, you can install it with Composer with the command composer require zircote/swagger-php. You can then add the necessary annotations to your PHP files, defining the information that you want to include in your API documentation. For instance:

    /**
     * @OA\Info(title="My First API", version="0.1")
     */
    
    /**
     * @OA\Get(
     *     path="/api/resource.json",
     *     @OA\Response(response="200", description="An example resource")
     * )
     */

To generate and display your documentation, you just need to call the appropriate methods as in the below example:

   <?php
   require("vendor/autoload.php");
   $openapi = \OpenApi\Generator::scan(['/path/to/project']);
   header('Content-Type: application/x-yaml');
   echo $openapi->toYaml();

You may set the version of your OpenAPI documentation using the Generator::setVersion() method. Also, you can utilize the command-line interface that's offered by Zircote/Swagger-PHP to generate the documentation into a static file.

Where are the zircote/swagger-php docs?

The full details of how to use the Zircote/Swagger-PHP package, including a comprehensive list of supported annotations, are available on the official documentation website. The website features a getting started guide, a guide to using the annotations, information on how to use the Generator class and much more. To dive deeper into real world examples, you can browse the Examples directory in the package's repository on GitHub.