fsbahman / apidoc-swagger

apidoc and swagger are two nice projects which are focusing on documentation of APIs. This project is a middle tier which tries to bring them together in a sense that it uses apidoc to convert inline documentation to json schema and later convert it to swagger json schmea.
Other
252 stars 129 forks source link

@apiParam and @apiSuccess are merged in schema definitions #4

Closed agrishin85 closed 9 years ago

agrishin85 commented 9 years ago

Given:

/**
 * @api {get} /user/id Request User information
 * @apiName GetUser
 * @apiGroup User
 *
 * @apiParam {Number} id Users unique ID.
 *
 * @apiSuccess {String} firstname Firstname of the User.
 * @apiSuccess {String} lastname  Lastname of the User.
 */

Build command:

apidoc-swagger -i app/ -o docs/

Produces:

"GetUser" : {
            "properties" : {
                "id" : {
                    "type" : "Number",
                    "description" : "<p>Users unique ID.</p> "
                },
                "firstname" : {
                    "type" : "String",
                    "description" : "<p>Firstname of the User.</p> "
                },
                "lastname" : {
                    "type" : "String",
                    "description" : "<p>Lastname of the User.</p> "
                }
            },
            "required" : ["id", "firstname", "lastname"]
        }

The "id" is an input parameter, but "firstname" and "lastname" is output parameters. All of them cannot be provided as the input parameters.

fsbahman commented 9 years ago

Hi, There were couple of changes to the repo and the issue you've mentioned is rectified, now success parameters are not counted as input parameters, could you please have a look and if it is OK then let me know or close the issue. Thanks

fyodorvi commented 8 years ago

Having same issue here with 0.2.2.

stephen1706 commented 6 years ago

hello im still facing the issue now. is there any fix?

weibird0917 commented 3 years ago

Having same issue here with 0.3.2