Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document not generate #29

Open
ntngamedev opened this issue Mar 30, 2020 · 1 comment
Open

Document not generate #29

ntngamedev opened this issue Mar 30, 2020 · 1 comment

Comments

@ntngamedev
Copy link

ntngamedev commented Mar 30, 2020

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
Copy link
Owner

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
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants