PHPackages                             wedo/openapi-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. wedo/openapi-generator

ActiveLibrary[API Development](/categories/api)

wedo/openapi-generator
======================

Open api json generator from typed classes

v2.0.0(4y ago)2114.6k↓42.7%MITPHPPHP ^8.0

Since Oct 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/WEDOehf/openapi-generator)[ Packagist](https://packagist.org/packages/wedo/openapi-generator)[ RSS](/packages/wedo-openapi-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (10)Used By (0)

Open API Generator
------------------

[](#open-api-generator)

Framework agnostic Open api generator from phpdoc and php type hints

---

[![Latest Stable Version](https://camo.githubusercontent.com/08ddbe5d1305f8815c4d9ce95f15f74d62e9c3b4439de8ea8b1464977ea80bb9/68747470733a2f2f706f7365722e707567782e6f72672f7765646f2f6f70656e6170692d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/wedo/openapi-generator)[![build](https://github.com/WEDOehf/openapi-generator/actions/workflows/main.yml/badge.svg)](https://github.com/WEDOehf/openapi-generator/actions/workflows/main.yml)[![codecov](https://camo.githubusercontent.com/663cfc67cf2efe7fb6ed46d115153265baa60089397555683831dc40421aa2d0/68747470733a2f2f636f6465636f762e696f2f67682f5745444f4568662f6f70656e6170692d67656e657261746f722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/WEDOEhf/openapi-generator)[![PHPStan](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/e031797bc2835755c5f0a7d17188584778474d9a3b4aec130072407e93630c8a/68747470733a2f2f706f7365722e707567782e6f72672f7765646f2f6f70656e6170692d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/wedo/openapi-generator)

Installation
------------

[](#installation)

```
$ composer require wedo/openapi-generator

```

Configuration
-------------

[](#configuration)

see src/Config.php

Usage
-----

[](#usage)

Check tests folder, there's full working minimal API there:

this is minimal config required to run, to check all options see src/Config.php

```
//minimal config
$config = new Config();
$config->baseRequest = BaseRequest::class;
$config->serverUrl = 'https://www.mydomain.com/api/v1';
$config->baseEnum = BaseEnum::class; // use with @see annotation if U want to provide user enum options
$config->requiredAnnotation = '@required'; //what annotation should be used on requests to confirm that parameter is required
$config->namespace = 'App\Api\Controllers\\';
$config->path = __DIR__ . 'Api/Controllers';

$generator = new Generator($config);

//add standard error response to ref list
$this->generator->onBeforeGenerate[] = function () {
    $this->generator->getRefProcessor()->generateRef(ClassType::from(ErrorResponse::class));
};

$this->generator->getClassProcessor()->getMethodProcessor()->onProcess[] = function() {
        // set some standard error responses for each endpoint
        $methodProcessor = $this->generator->getClassProcessor()->getMethodProcessor();
        $path->responses[400] = $methodProcessor->createResponse('Bad request error response', 'ErrorResponse');

        $annotations = $method->getAnnotations();
        if (!empty($annotations['throws'])) {
            // add your own error responses classes for some specific exceptions
        }
}

//set some title
$this->generator->getJson()->info->title = 'My api';

//add your security schemes if needed
$this->generator->getJson()->components->securitySchemes = [
    'APIKeyHeader' => [
            'type' => 'apiKey',
            'in' => 'header',
            'name' => 'api-key',
        ]
];

$json = $this->generator->generate();
file_put_contents('open-api.json', $json);
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Total

9

Last Release

1594d ago

Major Versions

v1.1.6 → v2.0.02022-01-05

PHP version history (3 changes)v1.0.0PHP ^7.1

v1.1.2PHP ^7.2|^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9631745a21cab7a86a7a8aa0903ae3d36f5528574040b616bd9293929fa9e14?d=identicon)[dkorpar](/maintainers/dkorpar)

---

Top Contributors

[![dakorpar](https://avatars.githubusercontent.com/u/9303856?v=4)](https://github.com/dakorpar "dakorpar (32 commits)")

---

Tags

apidocumentationswaggeropenapigenerator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wedo-openapi-generator/health.svg)

```
[![Health](https://phpackages.com/badges/wedo-openapi-generator/health.svg)](https://phpackages.com/packages/wedo-openapi-generator)
```

###  Alternatives

[swagger-api/swagger-ui

 Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

28.7k45.4M99](/packages/swagger-api-swagger-ui)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
