PHPackages                             psx/asyncapi - 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. psx/asyncapi

ActiveLibrary[API Development](/categories/api)

psx/asyncapi
============

Model classes to generate an AsyncAPI specification in a type-safe way

v0.2.1(5mo ago)2690↓33.3%Apache-2.0PHPPHP &gt;=8.1CI passing

Since Apr 7Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/apioo/psx-asyncapi)[ Packagist](https://packagist.org/packages/psx/asyncapi)[ Docs](https://phpsx.org)[ Fund](https://www.paypal.me/fusioapi)[ GitHub Sponsors](https://github.com/chriskapp)[ RSS](/packages/psx-asyncapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (5)Used By (0)

AsynAPI
=======

[](#asynapi)

About
-----

[](#about)

This library contains model classes to generate an AsyncAPI specification in a type-safe way. The models are automatically generated based on the [TypeSchema](https://typeschema.org/) specification (s. `typeschema.json`). The following example shows how you can generate an OpenAPI spec:

```
$info = new Info();
$info->setTitle('Account Service');
$info->setVersion('1.0.0');
$info->setDescription('This service is in charge of processing user signups :rocket:');

$message = new Message();
$message->setPayload(Record::fromArray(['$ref' => '#/components/schemas/Pet']));

$http = new HttpOperationBinding();
$http->setType('request');
$http->setMethod('POST');

$bindings = new OperationBindings();
$bindings->setHttp($http);

$operation = new Operation();
$operation->setMessage($message);
$operation->setBindings($bindings);

$channel = new Channel();
$channel->setPublish($operation);

$channels = new Channels();
$channels->put('user/signedup', $channel);

$schemas = new Schemas();
$schemas->put('Pet', [
    'required' => ['id', 'name'],
    'properties' => [
        'id' => ['type' => 'integer', 'format' => 'int64'],
        'name' => ['type' => 'string'],
        'tag' => ['type' => 'string'],
    ]
]);

$components = new Components();
$components->setSchemas($schemas);

$asyncAPI = new AsyncAPI();
$asyncAPI->setInfo($info);
$asyncAPI->setChannels($channels);
$asyncAPI->setComponents($components);

echo json_encode($asyncAPI, JSON_PRETTY_PRINT);
```

This would result in the following JSON:

```
{
  "asyncapi": "2.6.0",
  "info": {
    "title": "Account Service",
    "description": "This service is in charge of processing user signups :rocket:",
    "version": "1.0.0"
  },
  "channels": {
    "user\/signedup": {
      "publish": {
        "bindings": {
          "http": {
            "type": "request",
            "method": "POST"
          }
        },
        "message": {
          "payload": {
            "$ref": "#\/components\/schemas\/Pet"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Pet": {
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        }
      }
    }
  }
}
```

Contribution
------------

[](#contribution)

If you want to suggest changes please only change the `typeschema.json` specification and then run the `php gen.php` script to regenerate all model classes.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance72

Regular maintenance activity

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~327 days

Total

4

Last Release

155d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2505846?v=4)[Christoph Kappestein](/maintainers/chriskapp)[@chriskapp](https://github.com/chriskapp)

---

Top Contributors

[![chriskapp](https://avatars.githubusercontent.com/u/2505846?v=4)](https://github.com/chriskapp "chriskapp (10 commits)")

---

Tags

asyncapiphpmodeldtoasyncapi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/psx-asyncapi/health.svg)

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

###  Alternatives

[phpexperts/simple-dto

A quick and easy DTO package.

521.1M7](/packages/phpexperts-simple-dto)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3847.7k1](/packages/rekalogika-mapper)[joskolenberg/laravel-jory

Create a flexible API for your Laravel application using json based queries.

4513.5k](/packages/joskolenberg-laravel-jory)[artyuum/request-dto-mapper-bundle

This bundle provides an easy way to automatically map the incoming request data to a DTO and optionally validate it.

515.8k](/packages/artyuum-request-dto-mapper-bundle)[formapro/values

Alter ego objects. Highly efficient way of building models, api clients and so on

3010.4k8](/packages/formapro-values)

PHPackages © 2026

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