Download the PHP package ehyiah/apidoc-bundle without Composer

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

ApiDocBundle

A Symfony Bundle to generate and display API documentation using OpenAPI (Swagger) v3. Define your documentation using YAML files, PHP classes, or a mix of both!

✨ Features


📚 Table of Contents


Installation

1. Allow Contrib Recipes

Ensure Symfony Flex allows contrib recipes:

2. Install the Bundle


Configuration

Bundle Configuration

The default configuration is automatically installed in config/packages/ehyiah_api_doc.yaml.

Custom URL

The documentation is available at /ehyiah/api/doc by default. You can customize this route in config/routes/ehyiah_api_doc.yaml.


UI Selection

You can choose from 5 modern UIs to display your documentation.

UI Value Description Try it out Links
Swagger UI swagger The standard, widely used ✅ Yes GitHub - Demo
Redoc redoc Clean, elegant 3-column layout ❌ No GitHub - Demo
Stoplight Elements stoplight Modern, customizable ✅ Yes GitHub - Demo
RapiDoc rapidoc Lightweight, dark/light themes ✅ Yes GitHub - Demo
Scalar scalar Beautiful, modern design ✅ Yes GitHub - Demo

Switching UI On-the-Fly

You can switch the interface dynamically using the ui query parameter:


Usage

1. YAML Configuration

Place your OpenAPI YAML files in the directory defined by source_path (default: src/Swagger). The bundle will automatically parse and merge all .yaml and .yml files in this folder.

Example src/Swagger/info.yaml:

2. PHP Configuration Classes

You can define your documentation programmatically using PHP classes. This offers strong typing and IDE autocompletion.

  1. Create a class that implements Ehyiah\ApiDocBundle\Interfaces\ApiDocConfigInterface.
  2. Implement the configure method.
  3. Your class is automatically autoloaded and parsed.

Example src/ApiDoc/UserDocConfig.php:

💡 Tip: While PHP config classes can be placed anywhere in src/, it is recommended to keep them in src/Swagger (or your source_path) if you want the Generator Commands to detect them and prevent duplicates.

📚 Read full PHP Config Documentation 📚 Read the PHP Builder Reference

3. IDE Integration

Link your Controller methods to their documentation using the #[ApiDoc] attribute. This allows you to Ctrl+Click from your Controller directly to the documentation source.


Component Generation

This bundle provides CLI commands to help you kickstart your documentation by generating reusable OpenAPI components.

Command Description Example
apidocbundle:component:schema Generates a Schema from a PHP Class. ...:schema "App\Entity\User"
apidocbundle:component:body Generates a Request Body from a PHP Class. ...:body "App\DTO\UserDTO"
apidocbundle:component:parameter Generates a reusable Parameter. ...:parameter "userId" --in=path
apidocbundle:component:header Generates a reusable Header. ...:header "X-Request-ID"
apidocbundle:component:response Generates a reusable Response. ...:response "NotFound" -s 404
apidocbundle:component:example Generates a reusable Example. ...:example "UserExample" --value='{"id":1}'
apidocbundle:component:security Generates a reusable Security Scheme. ...:security "ApiKeyAuth" --type=apiKey
apidocbundle:route:generate Interactively generates a Route path. ...:route:generate /my/path

Command Options

Option Used in Shortcut Description
--format All -f Output format: yaml (default), php, or both.
--output All -o Custom output directory (relative to project root).
--description All -d Description for the generated component.
--tag Route -t (Route only) Tags to associate with the route.
--response-schema Route -rs (Route only) Reference schema for the response.
--request-body Route -rb (Route only) Reference schema for the request body.
--in Parameter (Parameter only) Location of the parameter: query, header, path, cookie.
--type Parameter (Parameter only) Schema type of the parameter: string, integer, etc.
--required Parameter (Parameter only) Mark the parameter as required.

📚 Read the Full Guide on References

Duplicate Detection

The commands are smart! They check if a component with the same name already exists:


Linting & Exporting

You can export your entire documentation to a single JSON or YAML file, which is useful for CI/CD linting (e.g., using vacuum).


All versions of apidoc-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/orm Version ^2.10|^3|^4
symfony/property-access Version ^6.1|^7.0|^8.0
symfony/yaml Version ^6.1|^7.0|^8.0
symfony/finder Version ^6.1|^7.0|^8.0
symfony/dependency-injection Version ^6.1|^7.0|^8.0
symfony/property-info Version ^6.1|^7.0|^8.0
symfony/form Version ^6.1|^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 ehyiah/apidoc-bundle contains the following files

Loading the files please wait ...