Download the PHP package ez-php/openapi without Composer
On this page you can find all versions of the php package ez-php/openapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ez-php/openapi
More information about ez-php/openapi
Files in ez-php/openapi
Download ez-php/openapi
More information about ez-php/openapi
Files in ez-php/openapi
Vendor ez-php
Package openapi
Short Description OpenAPI 3.x spec generator for the ez-php framework — PHP attributes on controllers, reflection-based spec building, GET /openapi.json endpoint
License MIT
Homepage https://github.com/ez-php/openapi
Package openapi
Short Description OpenAPI 3.x spec generator for the ez-php framework — PHP attributes on controllers, reflection-based spec building, GET /openapi.json endpoint
License MIT
Homepage https://github.com/ez-php/openapi
Please rate this library. Is it a good library?
Informations about the package openapi
ez-php/openapi
OpenAPI 3.0.0 spec generator for the ez-php framework. Annotate controller methods with PHP attributes and get a live GET /openapi.json endpoint — no code generation, no annotation parsing framework, no YAML.
Installation
Register the service provider in provider/modules.php:
Usage
Add attributes to your controller methods:
Visit GET /openapi.json to retrieve the generated spec.
Attributes
#[ApiOperation]
| Parameter | Type | Default | Description |
|---|---|---|---|
$summary |
string |
'' |
Short description of the operation |
$description |
string |
'' |
Longer Markdown description |
$tags |
list<string> |
[] |
Tag names for grouping in the UI |
Not repeatable — one per method.
#[ApiResponse]
| Parameter | Type | Default | Description |
|---|---|---|---|
$status |
int |
— | HTTP status code (required) |
$description |
string |
'' |
Human-readable description |
$schemaClass |
?string |
null |
FQCN used to emit a $ref in the response |
Repeatable — multiple responses per method.
#[ApiParam]
| Parameter | Type | Default | Description |
|---|---|---|---|
$name |
string |
— | Parameter name (required) |
$type |
string |
'string' |
JSON Schema type: string, integer, boolean |
$in |
string |
'query' |
Location: path, query, header, cookie |
$required |
bool |
false |
Whether required (path params always required) |
$description |
string |
'' |
Human-readable description |
Repeatable — multiple parameters per method.
Configuration
| Key | Default | Description |
|---|---|---|
app.name |
'API' |
Spec info.title |
app.version |
'1.0.0' |
Spec info.version |
openapi.endpoint |
'/openapi.json' |
URI for the generated spec |
Notes
- Only
[Controller::class, 'method']handler routes are reflected for attributes. Closure-based routes appear in the spec without attribute data. - Path parameters (
{id}) are auto-detected from route patterns and added asin: 'path', required: true, type: 'string'when not explicitly declared via#[ApiParam]. - Component schemas (
#/components/schemas/...) referenced by$schemaClassmust be registered separately — this module generates the$refbut not the schema definition.
All versions of openapi with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.5
ez-php/contracts Version ^1.0
ez-php/http Version ^1.0
ez-php/framework Version ^1.0
ez-php/contracts Version ^1.0
ez-php/http Version ^1.0
ez-php/framework Version ^1.0
The package ez-php/openapi contains the following files
Loading the files please wait ...