PHPackages                             membrane/openapi-reader - 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. membrane/openapi-reader

ActiveLibrary[API Development](/categories/api)

membrane/openapi-reader
=======================

3.1.0(2mo ago)015.0k↓17.6%1[16 issues](https://github.com/membrane-php/openapi-reader/issues)2MPL-2.0PHPPHP ^8.4.0CI passing

Since Sep 11Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/membrane-php/openapi-reader)[ Packagist](https://packagist.org/packages/membrane/openapi-reader)[ RSS](/packages/membrane-openapi-reader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (14)Versions (19)Used By (2)

OpenAPI Reader
==============

[](#openapi-reader)

This library is intended to be used in conjunction with other Membrane libraries.

It wraps the [php-openapi](https://github.com/cebe/php-openapi) library with some additional validation, including Membrane-specific requirements.

Requirements
------------

[](#requirements)

- A valid [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification#readme).
- An operationId on all [Operation Objects](https://spec.openapis.org/oas/v3.1.0#operation-object) so that each route is uniquely identifiable.

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

[](#installation)

```
composer require membrane/openapi-router

```

Quick Start
-----------

[](#quick-start)

### Instantiate a Reader

[](#instantiate-a-reader)

```
$versions = [\Membrane\OpenAPIReader\OpenAPIVersion::Version_3_0];

$reader = new \Membrane\OpenAPIReader\Reader($versions);
```

### Read From An Absolute File Path

[](#read-from-an-absolute-file-path)

This method is the main use-case of the reader and is capable of *resolving all references.*

If your file path contains the file extension then the reader can use this to determine which language the OpenAPI is written in.

```
// code to instantiate reader...

$reader->readFromAbsoluteFilePath('~/path/to/my-openapi.yaml');
```

Otherwise, you may ensure it reads the file as a specific format by providing a second argument:

```
// code to instantiate reader...

$fileFormat = \Membrane\OpenAPIReader\FileFormat::Json;

$reader->readFromAbsoluteFilePath('my-openapi', $fileFormat);
```

### Read From A String

[](#read-from-a-string)

This method is only capable of resolving [Reference Objects](https://spec.openapis.org/oas/v3.1.0#reference-object-example), it cannot resolve references to [Relative Documents](https://spec.openapis.org/oas/v3.1.0#relative-schema-document-example).

Because the OpenAPI will be read from a string, the FileFormat MUST be provided.

```
// code to instantiate reader...

$myOpenAPI = '';
$fileFormat = \Membrane\OpenAPIReader\FileFormat::Json;

$reader->readFromString($myOpenAPI, $fileFormat)
```

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance86

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 88.6% 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 ~114 days

Recently: every ~171 days

Total

9

Last Release

67d ago

Major Versions

1.0.2 → 2.0.02024-04-17

2.1.1 → 3.0.02025-01-08

PHP version history (2 changes)1.0.0PHP ^8.1.0

3.1.0PHP ^8.4.0

### Community

Maintainers

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

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

---

Top Contributors

[![charjr](https://avatars.githubusercontent.com/u/102669158?v=4)](https://github.com/charjr "charjr (117 commits)")[![carnage](https://avatars.githubusercontent.com/u/846596?v=4)](https://github.com/carnage "carnage (15 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/membrane-openapi-reader/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

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

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[onmoon/openapi-server-bundle

Symfony bundle to create a fully-featured API server from an OpenAPI v3 specification

1117.7k](/packages/onmoon-openapi-server-bundle)

PHPackages © 2026

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