2017 © Pedro Peláez
 

library symfony-jsonrpc-http-server-swagger-doc

Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation

image

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

Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation

  • Monday, May 14, 2018
  • by yoanm
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • Makefile
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Symfony JSON-RPC Http server swagger documentation

License Code size Dependabot Status, (*1)

Scrutinizer Build Status Scrutinizer Code Quality Codacy Badge, (*2)

CI codecov Symfony Versions, (*3)

Latest Stable Version Packagist PHP version, (*4)

Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation, (*5)

Symfony bundle for yoanm/jsonrpc-http-server-swagger-doc-sdk, (*6)

Versions

  • Symfony v3/4 - PHP >=7.1 : ^v0.X
  • Symfony v4/5 - PHP >=7.2 : ^v1.0

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., (*7)

See below how to configure it., (*8)

Configuration

Behat demo app configuration folders can be used as examples., (*9)

  • Add the bundles in your config/bundles.php file:, (*10)

    // 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 documentation., (*11)

  • Configure yoanm/symfony-jsonrpc-http-server-doc as described on yoanm/symfony-jsonrpc-http-server-doc documentation., (*12)

  • Query your project at /doc/swagger.json endpoint and you will have a swagger json documentation file of your server., (*13)

Event

You are able to enhance resulting documentation by listening on json_rpc_http_server_swagger_doc.array_created event., (*14)

See below an example of listener service configuration:, (*15)

  method_doc_created.listener:
    class: Full\Namespace\DocCreatedListener # <-- replace by your class name
    tags:
      - name: 'kernel.event_listener'
        event: 'json_rpc_http_server_swagger_doc.array_created'
        method: 'enhanceMethodDoc' # <-- replace by your method name

You will receive an event of type SwaggerDocCreatedEvent., (*16)

You can take example on Behat DocCreatedListener, (*17)

Contributing

See contributing note, (*18)

The Versions