RemyJeancolas / restify-swagger-jsdoc

Create Swagger documentation page based on jsdoc
MIT License
13 stars 20 forks source link

Document not generate #29

Open ntngamedev opened 4 years ago

ntngamedev commented 4 years ago

Sorry, my bad english.

I'm using this code to generate the documentation:

    this.application = restify.createServer({
      name: 'api',
      version: 'v1'
    })

    swagger.createSwaggerPage(
      {
        title: "API",
        version: "v1",
        server: this.application,
        path: "/docs/swagger"
      }
    )

But the json it generates is this: {"info":{"title":"API","version":"v1"},"basePath":"/","tags":[],"swagger":"2.0","paths":{},"definitions":{},"responses":{},"parameters":{}}

"restify": "^8.5.1" "restify-swagger-jsdoc": "^3.2.3"

RemyJeancolas commented 4 years ago

Hi @valeriobleite ,

You need to provide the path(s) to your annotated files using the apis parameter. For example if your files are in the example/routes/ folder, you need to use:

swagger.createSwaggerPage({
  title: "API",
  version: "v1",
  server: this.application,
  path: "/docs/swagger",
  apis: ["example/routes/*.js"] // This parameter is an array so that you can pass multiple paths if needed
});