PHPackages                             psx/api-bundle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. psx/api-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

psx/api-bundle
==============

Symfony bundle to build type-safe APIs

v0.1.2(8mo ago)315MITPHPPHP &gt;=8.2CI passing

Since Dec 30Pushed 7mo ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (4)Used By (0)

PSX API Bundle
==============

[](#psx-api-bundle)

The PSX API bundle integrates the [PSX API components](https://phpsx.org/) into Symfony which help to build fully type-safe REST APIs. Basically the bundle provides additional attributes which you can use at your [controller](#controller) to map HTTP parameters to arguments of your controller and commands to generate based on those attributes and type-hints different artifacts:

- Generate Client SDKs for different languages i.e. TypeScript and PHP
    - `php bin/console generate:sdk client-typescript`
- Generate OpenAPI specification without additional attributes
    - `php bin/console generate:sdk spec-openapi`
- Generate DTO classes using [TypeSchema](https://typeschema.org/)
    - `php bin/console generate:model`

As you note this bundle is about REST APIs and not related to any PlayStation content, the name PSX was invented way back and is simply an acronym which stands for "**P**HP, **S**QL, **X**ML"

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

[](#installation)

To install the bundle simply require the composer package at your Symfony project.

```
composer require psx/api-bundle

```

Make sure, that the bundle is registered at the `config/bundles.php` file:

```
return [
    PSX\ApiBundle\PSXApiBundle::class => ['all' => true],
];
```

Controller
----------

[](#controller)

The following is a simple controller which shows how to use the PSX specific attributes to describe different HTTP parameters:

```
