PHPackages                             exsyst/swagger - 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. exsyst/swagger

ActiveLibrary[API Development](/categories/api)

exsyst/swagger
==============

A php library to manipulate Swagger specifications

v0.4.2(5y ago)35916.2M—7.1%9[1 issues](https://github.com/GuilhemN/swagger/issues)[1 PRs](https://github.com/GuilhemN/swagger/pulls)7MITPHPPHP ^7.0|^8.0

Since Jul 29Pushed 5y ago2 watchersCompare

[ Source](https://github.com/GuilhemN/swagger)[ Packagist](https://packagist.org/packages/exsyst/swagger)[ RSS](/packages/exsyst-swagger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (15)Used By (7)

Swagger
=======

[](#swagger)

[![Build Status](https://camo.githubusercontent.com/3a77d489c2342eeea2e1a22106003282931ae6117bf67e752d780b77272c0fdc/68747470733a2f2f7472617669732d63692e6f72672f4775696c68656d4e2f737761676765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GuilhemN/swagger)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/af036e51d49a252c8f2311efff4f4304f77a4d1c933d114bb4c6792ec4b5a9c0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4558537973742f537761676765722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/EXSyst/Swagger)[![Code Coverage](https://camo.githubusercontent.com/452dbf61918c3dc6b697dfec269fc0a191e79216ef8ea0e179a9fddb4f2445eb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4558537973742f537761676765722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/EXSyst/Swagger)

A php library to manipulate [Swagger](http://Swagger.io)/[Open API](https://openapis.org) specifications.

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

[](#installation)

```
composer require EXSyst/Swagger

```

Usage
-----

[](#usage)

Read an `api.json` file:

```
$swagger = Swagger::fromFile('api.json');

// or

$swagger = new Swagger($array);
```

### Collections

[](#collections)

There are two major collections: `Paths` and `Definitions`. The API is similar for both:

```
$paths = $swagger->getPaths();
$p = new Path('/user');

foreach ($paths as $path) {
	// adding
	$paths->add($a);

	// retrieving
	if ($paths->has('/user') || $paths->contains($p)) {
		$path = $paths->get('/user');
	}

	// removing
	$paths->remove('/user');
}
```

### Models

[](#models)

There are a lot of models, e.g. the mentioned `Path` above. The API is well written, so it works with the auto-completion of your IDE. It is straight forward and uses the same naming scheme as the OpenAPI specification.

Contributing
------------

[](#contributing)

Feel free to fork and submit a pull request (don't forget the tests) and I am happy to merge.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity63

Solid adoption and visibility

Community25

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 53.8% 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 ~143 days

Recently: every ~283 days

Total

12

Last Release

2006d ago

PHP version history (2 changes)v0.1.0PHP ^7.0

v0.4.2PHP ^7.0|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11444712?v=4)[EXSyst](/maintainers/EXSyst)[@EXSyst](https://github.com/EXSyst)

---

Top Contributors

[![gossi](https://avatars.githubusercontent.com/u/283700?v=4)](https://github.com/gossi "gossi (21 commits)")[![GuilhemN](https://avatars.githubusercontent.com/u/6871899?v=4)](https://github.com/GuilhemN "GuilhemN (8 commits)")[![dragosprotung](https://avatars.githubusercontent.com/u/1081073?v=4)](https://github.com/dragosprotung "dragosprotung (4 commits)")[![phansys](https://avatars.githubusercontent.com/u/1231441?v=4)](https://github.com/phansys "phansys (4 commits)")[![choonge](https://avatars.githubusercontent.com/u/334814?v=4)](https://github.com/choonge "choonge (1 commits)")[![chregu](https://avatars.githubusercontent.com/u/47106?v=4)](https://github.com/chregu "chregu (1 commits)")

### Embed Badge

![Health badge](/badges/exsyst-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/exsyst-swagger/health.svg)](https://phpackages.com/packages/exsyst-swagger)
```

###  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)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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