Download the PHP package chamber-orchestra/openapi-doc-bundle without Composer

On this page you can find all versions of the php package chamber-orchestra/openapi-doc-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 openapi-doc-bundle

OpenAPI ADR Bundle

Symfony bundle that auto-generates OpenAPI 3.0.1 documentation for applications built on the Action-Domain-Responder (ADR) pattern. Works by scanning PHP source files for action classes annotated with #[Operation] and #[Route] attributes — no YAML configuration required.

Features

Requirements

Installation

Register the bundle in config/bundles.php:

Configuration

proto.yaml

Create a proto.yaml file in your project root. This file is merged into the final output and must contain securitySchemes for security annotations to appear in the generated documentation:

Note: Without securitySchemes in proto.yaml, #[IsGranted] annotations are silently ignored and operations appear as public in the generated documentation.

Usage

1. Annotate action classes

Each invokable action class needs #[Route] and #[Operation]:

2. POST/PUT/PATCH — request body from a Form

The form fields are read at generation time and become the requestBody schema. Symfony validation constraints are mapped to OpenAPI constraints:

Constraint OpenAPI
NotBlank required: [field] at schema level
Length(min, max) minLength, maxLength
Range(min, max) minimum, maximum
Positive minimum: 1
GreaterThanOrEqual(n) minimum: n
Count(min, max) minItems, maxItems (array fields)
Email format: email
Url format: uri
ChoiceType(choices) enum values

Form example

This generates the following OpenAPI schema:

Nested form (sub-form as object)

Generated schema:

Collection of sub-forms

Generated schema:

3. GET — form fields become query parameters

GET/DELETE/HEAD actions automatically expand form fields into query parameters instead of a request body:

Each field becomes an individual query parameter:

4. Multiple responses (including shared references from proto.yaml)

5. Custom security

Override security for a specific operation (e.g., API key instead of the default Bearer):

Disable security for a public endpoint:

6. Annotating DTO properties

Use #[Property] to mark a property as required or add arbitrary OpenAPI attributes:

7. Iterable views (lists)

Use #[Type] from chamber-orchestra/view-bundle to specify the item type:

Generates:

8. Vendor extensions (x-* keys)

Use #[Extension] (repeatable) on a request class (form type, DTO) or response class (view, DTO) to add OpenAPI specification extensions to its generated schema:

Generates:

The extension name must start with x-; values may be any scalar, array, or null.

Notes:

Generating documentation

Options:

Example:

Type mapping reference

PHP types → OpenAPI

PHP type OpenAPI
string type: string
int type: integer
float type: number
bool type: boolean
array / iterable type: array
BackedEnum type: string\|integer + enum: [...]
Uuid / Ulid type: string, format: uuid
DateTime / DateTimeImmutable type: string, format: date-time
Custom class $ref: '#/components/schemas/ClassName'

Form field types → OpenAPI

Symfony type OpenAPI
TextType type: string
IntegerType type: integer
NumberType type: number
CheckboxType type: boolean
EmailType type: string, format: email
UrlType type: string, format: uri
DateType type: string, format: date
DateTimeType type: string, format: date-time
ChoiceType type: string + enum: [...]
ChoiceType(multiple: true) type: array, items: { enum: [...] }
CollectionType type: array, items: { ... }
RepeatedType type: object with sub-properties
Custom FormTypeInterface $ref: '#/components/schemas/FormName'

Architecture

Running tests

License

MIT


All versions of openapi-doc-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ext-json Version *
chamber-orchestra/view-bundle Version 8.1.*
symfony/config Version 8.1.*
symfony/console Version 8.1.*
symfony/dependency-injection Version 8.1.*
symfony/form Version 8.1.*
symfony/http-kernel Version 8.1.*
symfony/routing Version 8.1.*
symfony/security-http Version 8.1.*
symfony/validator Version 8.1.*
symfony/yaml Version 8.1.*
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 chamber-orchestra/openapi-doc-bundle contains the following files

Loading the files please wait ...