PHPackages                             therealgambo/php-raml-parser - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. therealgambo/php-raml-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

therealgambo/php-raml-parser
============================

A RAML parser built in php

2.2.0(9y ago)071MITPHPPHP &gt;=5.5.9

Since Jun 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/therealgambo/php-raml-parser)[ Packagist](https://packagist.org/packages/therealgambo/php-raml-parser)[ Docs](https://github.com/alecsammon/php-raml-parser)[ RSS](/packages/therealgambo-php-raml-parser/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (30)Used By (0)

PHP RAML Parser
===============

[](#php-raml-parser)

**!!Attention!!** this is a work-in-progress of the RAML 1.0 specification, for RAML 0.8 see the [master branch](https://github.com/alecsammon/php-raml-parser/tree/master)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#attention-this-is-a-work-in-progress-of-the-raml-10-specification-for-raml-08-see-the-master-branch)

### Still TODO:

[](#still-todo)

- [User defined facets](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#user-defined-facets)
- Full implementation of [type expressions](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#type-expressions)
    - The shorthand array and the union type have been implemented
    - Bi-dimensional array and the array-union combination have **NOT** been implemented yet.
- [Multiple inheritance](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#multiple-inheritance)
- [Annotations](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#annotations)
- [Libraries](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#libraries)
- [Overlays and Extensions](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#overlays-and-extensions)
- [Improved Security Schemes](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#security-schemes)

Original documentation
----------------------

[](#original-documentation)

Parses a RAML file into a PHP object.

[![Build Status](https://camo.githubusercontent.com/8b40cf10e6010e33759441d1ecc52e91b7068acb271fb1228a21056bab501512/68747470733a2f2f7472617669732d63692e6f72672f616c656373616d6d6f6e2f7068702d72616d6c2d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alecsammon/php-raml-parser)[![Coverage Status](https://camo.githubusercontent.com/d3295898775ab33275617aa93504c81bc3af45057155a53cbe244f40b129da05/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f616c656373616d6d6f6e2f7068702d72616d6c2d7061727365722e737667)](https://coveralls.io/r/alecsammon/php-raml-parser?branch=master)[![HHVM Status](https://camo.githubusercontent.com/09fce7517844a1fa9fe42a5a588a19a1c324a68cde2ef9a8679af22039e5ec6c/687474703a2f2f6868766d2e683463632e64652f62616467652f616c656373616d6d6f6e2f7068702d72616d6c2d7061727365722e706e67)](http://hhvm.h4cc.de/package/alecsammon/php-raml-parser)

See the RAML spec here:

### Get started

[](#get-started)

Requires:

- composer (see )

```
composer require alecsammon/php-raml-parser --dev
```

```
$parser = new \Raml\Parser();
$apiDef = $parser->parse($filename, true);

$title = $apiDef->getTitle();
```

### Parsing schemas

[](#parsing-schemas)

The library can convert schemas into an validation object. There is a default list, or they can be configured manually. Each schema parser needs to conform to `\Raml\Schema\SchemaParserInterface` and will return a instance of `\Raml\Schema\SchemaDefinitionInterface`.

Additional parsers and schema definitions can be created and passed into the `\Raml\Parser` constructor

### Exporting routes

[](#exporting-routes)

It is also possible to export the entire RAML file to an array of the full endpoints. For example, considering a [basic RAML](https://github.com/alecsammon/php-raml-parser/blob/master/test/fixture/simple.raml), this can be returned using:

```
$parser = new Raml\Parser();
$api = $parser->parse('test/fixture/simple.raml');

$routes = $api->getResourcesAsUri();
```

To return:

```
[
	GET /songs => ...
	POST /songs => ...
	GET /songs/{songId} => ...
	DELETE /songs/{songId} => ...
]

$routes = $api->getResourcesAsUri(new Raml\RouteFormatter\NoRouteFormatter());
```

#### Route Formatters

[](#route-formatters)

There are two Route Formatters included in this package:

- `NoRouteFormatter` which does nothing and simply echoes the result
- `SymfonyRouteFormatter` which adds the routes to a Symfony `RouteCollection`

### Contributing

[](#contributing)

```
./vendor/bin/phpunit
./vendor/bin/phpunit --coverage-text
./vendor/bin/phpcs --standard=PSR1,PSR2 src
```

### TODO

[](#todo)

- Documentation/Markdown parser
- Date Representations?
- Parse RAML at provided URL

### Supported (I Believe)

[](#supported-i-believe)

- Includes
    - .yml/.yaml
    - .raml/.rml
    - .json (parsed using json-schema)
- Display Name
- Traits
- Resource Types

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% 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 ~32 days

Recently: every ~109 days

Total

28

Last Release

3461d ago

Major Versions

0.6.3 → 1.0.02015-03-26

1.1.1 → 2.0.0.x-dev2015-06-14

PHP version history (2 changes)2.1.1PHP &gt;=5.4

2.2.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/16508af8974811d2054f1b0dcb5e4cd159ed19c3428e9356fa8bbfc85c360ae8?d=identicon)[therealgambo](/maintainers/therealgambo)

---

Top Contributors

[![alecsammon](https://avatars.githubusercontent.com/u/304636?v=4)](https://github.com/alecsammon "alecsammon (116 commits)")[![InfopactMLoos](https://avatars.githubusercontent.com/u/22300844?v=4)](https://github.com/InfopactMLoos "InfopactMLoos (24 commits)")[![qpautrat](https://avatars.githubusercontent.com/u/1844413?v=4)](https://github.com/qpautrat "qpautrat (20 commits)")[![pies](https://avatars.githubusercontent.com/u/37940?v=4)](https://github.com/pies "pies (18 commits)")[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (5 commits)")[![cozylife](https://avatars.githubusercontent.com/u/81341241?v=4)](https://github.com/cozylife "cozylife (3 commits)")[![titomiguelcosta](https://avatars.githubusercontent.com/u/192639?v=4)](https://github.com/titomiguelcosta "titomiguelcosta (3 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (3 commits)")[![rgeraads](https://avatars.githubusercontent.com/u/6044164?v=4)](https://github.com/rgeraads "rgeraads (1 commits)")[![toni-baumann-usp](https://avatars.githubusercontent.com/u/80098052?v=4)](https://github.com/toni-baumann-usp "toni-baumann-usp (1 commits)")[![darh](https://avatars.githubusercontent.com/u/1500447?v=4)](https://github.com/darh "darh (1 commits)")[![DimitriGilbert](https://avatars.githubusercontent.com/u/729282?v=4)](https://github.com/DimitriGilbert "DimitriGilbert (1 commits)")[![jeromemacias](https://avatars.githubusercontent.com/u/582446?v=4)](https://github.com/jeromemacias "jeromemacias (1 commits)")[![JMLamodiere](https://avatars.githubusercontent.com/u/6639701?v=4)](https://github.com/JMLamodiere "JMLamodiere (1 commits)")[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (1 commits)")[![nacmartin](https://avatars.githubusercontent.com/u/154258?v=4)](https://github.com/nacmartin "nacmartin (1 commits)")[![Philzen](https://avatars.githubusercontent.com/u/1634615?v=4)](https://github.com/Philzen "Philzen (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/therealgambo-php-raml-parser/health.svg)

```
[![Health](https://phpackages.com/badges/therealgambo-php-raml-parser/health.svg)](https://phpackages.com/packages/therealgambo-php-raml-parser)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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