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

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

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

Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation

v3.0.2(8mo ago)128.8k↓33.3%3[1 issues](https://github.com/yoanm/symfony-jsonrpc-http-server-openapi-doc/issues)[3 PRs](https://github.com/yoanm/symfony-jsonrpc-http-server-openapi-doc/pulls)MITPHPPHP ^8.0CI failing

Since Apr 20Pushed 4mo ago1 watchersCompare

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

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

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

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

[![License](https://camo.githubusercontent.com/c89819406b783d6d7854155ac7ae3b848d83c24279faa9bae58a5a4966f98d7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632e737667)](https://github.com/yoanm/symfony-jsonrpc-http-server-openapi-doc)[![Code size](https://camo.githubusercontent.com/f611f6f52666bcaf208443098886e0f83d1ccc8a93f4fabd5a9d7b5a1d4f475e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632e737667)](https://github.com/yoanm/symfony-jsonrpc-http-server-openapi-doc)[![Dependabot Status](https://camo.githubusercontent.com/3b6a85c78540d488091635dac85714314c3804be18875472c2073370e14d9b65/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f646570656e6461626f742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f63)](https://camo.githubusercontent.com/3b6a85c78540d488091635dac85714314c3804be18875472c2073370e14d9b65/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f646570656e6461626f742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f63)[![Last commit](https://camo.githubusercontent.com/f2c7c5364a331c668ea172a4ad3edb354d4603fb784f83fc61767caaf7a62beb/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6173742d636f6d6d69742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f63)](https://camo.githubusercontent.com/f2c7c5364a331c668ea172a4ad3edb354d4603fb784f83fc61767caaf7a62beb/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6173742d636f6d6d69742f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f63)

[![Scrutinizer Build Status](https://camo.githubusercontent.com/040de6cc00e0af306dd60352472ce7a9284faba733ba0a94f475dc138784e346/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632e7376673f6c6162656c3d5363727574696e697a6572266c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-openapi-doc/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dff49768d25878a1fc46bbffe30d656285af228e641455bf36b6cbd0f5662575/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632f6d61737465722e7376673f6c6f676f3d7363727574696e697a6572)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-openapi-doc/?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/cac99e4634700a9ea967cfa246c4db23681aa11ff6da112edb6c6ac2e3ef436b/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6566306637623234326532343435646662333334396362376562313737383562)](https://app.codacy.com/gh/yoanm/symfony-jsonrpc-http-server-openapi-doc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

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

[![Latest Stable Version](https://camo.githubusercontent.com/27a2f717aec9e66f7138def93a1b474a6dd915fae97cc7c6cd385c0118c7fe6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632e737667)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-openapi-doc)[![Packagist PHP version](https://camo.githubusercontent.com/be8e6ff21068f894b1a5f53a4510b3d7cdf04dfd7434f945a5bfcc68b7aa8174/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f796f616e6d2f73796d666f6e792d6a736f6e7270632d687474702d7365727665722d6f70656e6170692d646f632e737667)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-openapi-doc)

Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation

Symfony bundle for [yoanm/jsonrpc-http-server-openapi-doc-sdk](https://github.com/yoanm/php-jsonrpc-http-server-openapi-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/openapi.json` endpoint. Result will be a openapi 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\SymfonyJsonRpcHttpServerOpenAPIDoc\JsonRpcHttpServerOpenAPIDocBundle::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/openapi.json` endpoint and you will have a OpenAPI json documentation file of your server.

Event
-----

[](#event)

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

See below an example of listener service configuration:

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