-
Notifications
You must be signed in to change notification settings - Fork 228
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
Implemented on Lambda Handler Functions yields missing info object error! #319
Comments
Hi, @pjcjonas Seems you have a project named |
I sort that out ASAP, in the mean time I fixed it by creating the swagger.js file below and running const express = require("express");
const swaggerJSDoc = require("swagger-jsdoc");
const app = express();
const fs = require("fs");
const options = {
definition: {
openapi: "3.0.0",
info: {
title: "Hello World",
description: "A sample API",
version: "1.0.0",
},
},
apis: ["./api*.js"],
};
const spec = swaggerJSDoc(options);
// ADDED THIS LINE
fs.writeFileSync("./swagger.json", JSON.stringify(spec)); OUTPUT {
"openapi": "3.0.0",
"info": {
"title": "Hello World",
"description": "A sample API",
"version": "1.0.0"
},
"paths": {
"/": {
"get": {
"description": "QQQQ Welcome to swagger-jsdoc!",
"responses": {
"200": { "description": "Returns a mysterious string." }
}
}
}
},
"components": {},
"tags": []
}
|
Awesome, I was debugging here. So, can we consider that this is working for you? |
I works when I used the So its working in a way but not sure if it is suppose to work using the yarn swagger-jsdoc by referencing the definition file and supplying an output |
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: