You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running the swagger-jsdoc command on the definition file I keep getting:
$> yarn swagger-jsdoc -d ./swaggerDef.js
yarn run v1.22.17
$ /Userscolldude/apihhooks/app/node_modules/.bin/swagger-jsdoc -d ./swaggerDef.js
Definition file should contain an info object!
More at http://swagger.io/specification/#infoObject
To Reproduce
Steps to reproduce the behavior:
1: Create lambda handler method
2: Add swagger or openapi commend.
3: create SW Deffinition file referencing the handler file.
I sort that out ASAP, in the mean time I fixed it by creating the swagger.js file below and running node swagger.js that then generates the json file for me included at the end:
constexpress=require("express");constswaggerJSDoc=require("swagger-jsdoc");constapp=express();constfs=require("fs");constoptions={definition: {openapi: "3.0.0",info: {title: "Hello World",description: "A sample API",version: "1.0.0",},},apis: ["./api*.js"],};constspec=swaggerJSDoc(options);// ADDED THIS LINEfs.writeFileSync("./swagger.json",JSON.stringify(spec));
Describe the bug
When running the swagger-jsdoc command on the definition file I keep getting:
To Reproduce
Steps to reproduce the behavior:
1: Create lambda handler method
2: Add swagger or openapi commend.
3: create SW Deffinition file referencing the handler file.
deffinition file:
Expected behavior
I am expecting a swagger json output to use with swagger ui
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
I am looking for a way to generate Swagger deffinition files to use with swagger UI in the same way that .net core uses Swashbuckle.
The text was updated successfully, but these errors were encountered: