PHPackages                             jdomenechb/openapi-class-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. jdomenechb/openapi-class-generator

ActiveLibrary[API Development](/categories/api)

jdomenechb/openapi-class-generator
==================================

Generate PHP classes from given OpenAPI contracts.

14PHPCI failing

Since Sep 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jdomenechb/openapi-class-generator)[ Packagist](https://packagist.org/packages/jdomenechb/openapi-class-generator)[ RSS](/packages/jdomenechb-openapi-class-generator/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (2)Used By (0)

OpenAPI Class Generator
=======================

[](#openapi-class-generator)

[![Build Status](https://camo.githubusercontent.com/15d0884a24e33795161cb51d1d2a24cf2779e02eb31e4b92d11190fd0362a96e/68747470733a2f2f7472617669732d63692e6f72672f6a646f6d656e656368622f6f70656e6170692d636c6173732d67656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jdomenechb/openapi-class-generator) [![Mutation testing badge](https://camo.githubusercontent.com/38d11f869d9be64e19294c1435cd6147590b4c3e678684f7415b261fdd33005c/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f6a646f6d656e656368622f6f70656e6170692d636c6173732d67656e657261746f722f6d6173746572)](https://stryker-mutator.github.io)

The aim of this library is to turn an OpenAPI v.3.x contract into PHP classes ready to use for communicate with the service behind the contract.

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

[](#installation)

```
composer require jdomenechb/openapi-class-generator
```

Usage
-----

[](#usage)

```
vendor/bin/ocg generate
```

**WARNING:** The contents of the output folder will be deleted entirely at each generation.

The namespace for the generated files can be defined by using `--namespace`:

```
vendor/bin/ocg generate contracts src-generated --namespace An\\Org\\Namespace
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1197b4ce0411048910993d1b98874c69f8811614aefc414b012d0eb7e4c7a314?d=identicon)[jdomenechb](/maintainers/jdomenechb)

---

Top Contributors

[![jdomenechb](https://avatars.githubusercontent.com/u/11862227?v=4)](https://github.com/jdomenechb "jdomenechb (130 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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