1

I'm trying to use Swagger-ui for my json-rpc server which was written by php. I use Swagger-PHP to generate json complaint container for Swagger-ui. So, I'm very new to Swagger and I use annotation for methods like that:

/**
 *  @SWG\Resource(
 *      apiVersion="0.2",
 *      swaggerVersion="0.8",
 *      basePath="http://mydomain.com",
 *      @SWG\Api(
 *          path="/rpc/json/server.php",
 *          description="Operations about Devices",
 *          @SWG\Operations(
 *              @SWG\Operation(
 *                  method="POST",
 *                  summary="Get device by ID",
 *                  nickname="getDevice",
 *                  @SWG\Parameters(
 *                      @SWG\Parameter(
 *                          name="deviceID",
 *                          description="device id",
 *                          required="true",
 *                          type="string"
 *                      )
 *                  ),
 *                  @SWG\ResponseMessages(
 *                      @SWG\ResponseMessage(code=404, message="Device not found")
 *                  )
 *              )
 *          )
 *      )
 *  )
*/

In SWG\Operation I need to add one more "method" in correspondence with json-rpc spec. As a result all requests will use POST method as part of http and json container will have its own "method" for each one.

The question - where should I start searching to solve this issue?

Sorry for my English. Not native.

Anton Glukhov
  • 3,507
  • 1
  • 15
  • 16

1 Answers1

0

Add additional @SWG\Operation()s inside the @SWG\Api() or @SWG\Operations()

I've added an example which demonstrates multiple operations in one @SWG\Api().

Does this answer your question?, i'm not familiar with the json-rpc spec.

Bob Fanger
  • 28,949
  • 7
  • 62
  • 78
  • Unfortunately no. It's strongly depends on JSON-RPC. If I add just one more Operation It will define addition json request, but not change JSON container. – Anton Glukhov Oct 31 '13 at 06:56