janvotava / swagger-koa

Swagger + Koa = {swagger-koa}
https://github.com/cyner/swagger-koa
MIT License
61 stars 17 forks source link

We were earlier using express and using jsdoc-express-with-swagger and using the jsdoc format and were able to reference definitions and tags as well as provide the response object. When we switched to koa that jsdoc did not work. #4

Open alkasdj opened 8 years ago

alkasdj commented 8 years ago

This is the jsdoc we used with express

/**
- @swagger
- /portfolio-company/{id}:
-   get:
-     description: Gets the portfolio company by identifier
-     tags:
-        - portfolio-company
-     parameters:
-        - name: Authorization
-          in: header
-          type: string
-          required: true
-          description: The authorization header
-        - name: id
-          in: path
-          type: string
-          required: true
-          description: Company Identifier
-        - name: code_scheme
-          in: query
-          type: string
-          required: false
-          enum: ["EntityId", "FCode", "Duns"]
-          default: "FCode"
-          description: Company CodeScheme - possible values are EntityId, FCode (default), DUNS,*
-        - name: parts
-          in: query
-          description: Parts to retrieve
-          required: false
-          type: array
-          collectionFormat: multi
-          enum: ["CompanyOverview", "ContactPersons", "BranchOffices", "Industries", "Products", "IPO", "UpcomingRounds", "Revenues"]
-     responses:
-       200:
-         description: The history entries
-         schema:
-            $ref: "#/definitions/portfolio_company_response"
-       404:
-         description: "Company could not be found"
  */

What is the best way to integrate with swagger using koa and where can I find the document specifications to write the jsdoc in correct format for swagger-koa to interpret.

vbuzzano commented 8 years ago

because you are using swagger V2. Currently Swagger-Koa is supporting only V1. I have done a request to be able to use V2.

DongramO commented 6 years ago

@vbuzzano So, Thanks your comment.I had the same problem. I could solve it thanks to your advice.