PHPackages                             tomi20v/phalswag - 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. tomi20v/phalswag

ActiveLibrary[API Development](/categories/api)

tomi20v/phalswag
================

phalswag is a swagger toolkit for php using cphalcon framework

0.1.0(11y ago)217wtfplPHP

Since Mar 30Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

phalswag is a component for the Phalcon framework, to validate incoming HTTP request against a swagger.json schema and also build the corresponding response the goal is to automate writing REST APIs as much as possible based on swagger definitions

simplest example using the supplied Phalcon Mvc Controller extension:

```
class UsersController extends Controller
{
	// by defining these,
	protected static $_swaggerPath = '../app/config/swagger';
	protected static $_swaggerFname = 'users.json';

	public function getAction() {

		try {

			$Response = $this->_process(
				// swagger operation ID
				'usersGet',
				// callback which receives input and shall return result data
				function($RequestModel) {
					$User = UserModel::findById($RequestModel->id);
					return $User;
				}
			);

		}
		catch (\Exception $e) {

			$Response = $this->ResponseBuilder->buildError(500);

		}

		return $Response;

	}
}
```

a more complete example would include:

```
// get the operation object
$Operation = $this->SwaggerService->getOperationById(
	$operationId,
	$this->_Swagger
);

// bind to request model
$this->SwaggerService->bindRequest(
	$RequestModel,
	$Operation,
	$this->dispatcher->getParams(),
	$this->request
);

// get response schema and build from data object
$ResponseSchema = $this->SwaggerService->getResponseSchema(
	200,
	$Operation,
	$this->_Swagger
);
$Result = $this->SwaggerService->buildBySchema(
	$Object,
	$ResponseSchema
);
```

current status: traversable models for most of swagger definition elements can populate a request model (class of your choice) with data from the HTTP input. can do basic validation of this data but eg cannot validate structures in body. it can build responses from models containing result data. it cannot resolve $ref 's.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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

Unknown

Total

1

Last Release

4068d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/480c5f31418502babb0cc333db32b167dc4837d9acd60f45241e3ac5c9bf3b72?d=identicon)[tomi20v](/maintainers/tomi20v)

---

Top Contributors

[![tomi20v](https://avatars.githubusercontent.com/u/547831?v=4)](https://github.com/tomi20v "tomi20v (25 commits)")[![SidRoberts](https://avatars.githubusercontent.com/u/1364214?v=4)](https://github.com/SidRoberts "SidRoberts (1 commits)")

### Embed Badge

![Health badge](/badges/tomi20v-phalswag/health.svg)

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

###  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)
