PHPackages                             yoanm/symfony-jsonrpc-http-server-swagger-doc - 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. yoanm/symfony-jsonrpc-http-server-swagger-doc

ActiveSymfony-bundle[API Development](/categories/api)

yoanm/symfony-jsonrpc-http-server-swagger-doc
=============================================

Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation

v3.0.2(7mo ago)04.5k↓100%[2 PRs](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/pulls)MITPHPPHP ^8.0CI failing

Since Apr 20Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc)[ Packagist](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-swagger-doc)[ RSS](/packages/yoanm-symfony-jsonrpc-http-server-swagger-doc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (17)Used By (0)

Symfony JSON-RPC Http server swagger documentation
==================================================

[](#symfony-json-rpc-http-server-swagger-documentation)

[![License](https://camo.githubusercontent.com/a6d0e53e574d8283dae7859f75afe48f1949a22a6cf276bd8ea883580393075d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632e737667)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc)[![Code size](https://camo.githubusercontent.com/30613abb150e4fe44c69a6c86145dc5567d296c7f8f950970ab21714f724afbd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632e737667)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc)[![Dependabot Status](https://camo.githubusercontent.com/f88f454d9531031ba165b00d675b2642bcb7782cc55faf44229fb25b5a426ead/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f646570656e6461626f742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f63)](https://camo.githubusercontent.com/f88f454d9531031ba165b00d675b2642bcb7782cc55faf44229fb25b5a426ead/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f646570656e6461626f742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f63)[![Last commit](https://camo.githubusercontent.com/82d00903c6494bbe4b7c81c0834af9de533709ac55c943215e8ebd17f4e19803/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6173742d636f6d6d69742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f63)](https://camo.githubusercontent.com/82d00903c6494bbe4b7c81c0834af9de533709ac55c943215e8ebd17f4e19803/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6173742d636f6d6d69742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f63)

[![Scrutinizer Build Status](https://camo.githubusercontent.com/0fb1e31b10e2f4c7fb7501e8ee6a2cb4f219930ab935465e8653e71f3a29142d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632e7376673f6c6162656c3d5363727574696e697a6572266c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-swagger-doc/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c650180ca1b7256e59a4f9437d2af12252a1105f86751ccd01e8772d4f345399/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632f6d61737465722e7376673f6c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-swagger-doc/?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/c7c6c13bc72dcfa47a4a71e77267f9267e591509e8a9fc35df390dd3c0859c65/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6535303236396432623762633436356661343361396639303030626335663036)](https://app.codacy.com/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

[![CI](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/yoanm/symfony-jsonrpc-http-server-swagger-doc/actions/workflows/CI.yml)[![codecov](https://camo.githubusercontent.com/f741e108e46683572adebed1a7d3051306e2b1d5e5f19acffd820b8305a2e45d/68747470733a2f2f636f6465636f762e696f2f67682f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4e486477454255464b35)](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server-swagger-doc)[![Symfony Versions](https://camo.githubusercontent.com/a0f96454a73e2467cd8e9274759de603045720eb9f2e4770b01951d648720bc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d76352e3425323025324625323076362e3425323025324625323076372e782d3838393242462e7376673f6c6f676f3d676974687562)](https://symfony.com/)

[![Latest Stable Version](https://camo.githubusercontent.com/e4c0e2fede347975e69e9f945ea6cc90288c6f931b2142764f6fa744f2023ace/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632e737667)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-swagger-doc)[![Packagist PHP version](https://camo.githubusercontent.com/0731e148fb6faadc77cb8e358811ed56adda98fc48479a85ab2313d9c5d6fa1d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d737761676765722d646f632e737667)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-swagger-doc)

Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation

Symfony bundle for [yoanm/jsonrpc-http-server-swagger-doc-sdk](https://github.com/yoanm/php-jsonrpc-http-server-swagger-doc-sdk)

Versions
--------

[](#versions)

- Symfony v3/4 - PHP &gt;=7.1 : `^v0.X`
- Symfony v4/5 - PHP &gt;=7.2 : `^v1.0`
- Symfony v4.4/5.4/6.0 - PHP ^8.0 : `^v2.0`
- Symfony v5.4/6.4/7.0 - PHP ^8.0 : `^v3.0`

How to use
----------

[](#how-to-use)

Once configured, your project is ready to handle HTTP `GET` request on `/doc/swagger.json` endpoint. Result will be a swagger compatible file.

See below how to configure it.

Configuration
-------------

[](#configuration)

[Behat demo app configuration folders](./features/demo_app) can be used as examples.

- Add the bundles in your config/bundles.php file:

    ```
    // config/bundles.php
    return [
        ...
        Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
        Yoanm\SymfonyJsonRpcHttpServer\JsonRpcHttpServerBundle::class => ['all' => true],
        Yoanm\SymfonyJsonRpcHttpServerDoc\JsonRpcHttpServerDocBundle::class => ['all' => true],
        Yoanm\SymfonyJsonRpcHttpServerSwaggerDoc\JsonRpcHttpServerSwaggerDocBundle::class => ['all' => true],
        ...
    ];
    ```
- Configure `yoanm/symfony-jsonrpc-http-server` as described on [yoanm/symfony-jsonrpc-http-server](https://github.com/yoanm/symfony-jsonrpc-http-server) documentation.
- Configure `yoanm/symfony-jsonrpc-http-server-doc` as described on [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) documentation.
- Query your project at `/doc/swagger.json` endpoint and you will have a swagger json documentation file of your server.

Event
-----

[](#event)

You are able to enhance resulting documentation by listening on `json_rpc_http_server_swagger_doc.array_created` event.

See below an example of listener service configuration:

```
  method_doc_created.listener:
    class: Full\Namespace\DocCreatedListener #
