Export Swagger documentation file from AWS ApiGateway

Search for a command to run...

No comments yet. Be the first to comment.
With the latest npm versions, you can trigger npx with npm init. Try it out with: npm init react-app Basically behind the scene, npm init will run npx create-react-app Based on that knowledge, letβs create a bootstrapper package and deploy it to the...
Your team has 14 versions of the same code review skill across 5 repos, with no way to sync them. when one improves, the others don't. drop a folder in .claude/skills/ and pray nothing drifts. source

AI agents are unreasonably good at writing SQL. They get specific error messages, fix their own mistakes in one retry, and can introspect query performance with EXPLAIN ANALYZE before you even ask. No

n8n has over 400 integrations. Zapier claims 7,000+. Every single one was hand-built, tested against a moving API, and will eventually break when that API ships a v2. The entire workflow automation in

Part of the "Your Next Startup" series, where I break down startup ideas I think are worth building. Auth0 sold for \(6.5B. Okta is worth \)15B+. CyberArk, Delinea, BeyondTrust, all printing money fro

For as long as software has existed, we've been building two doors into our systems. Door one: the UI, a carefully designed surface where humans point, click, and occasionally rage-quit. Door two: the

When developing a serverless function over AWS lambda and APIGateway, it is very useful to export the documentation as a swagger file, and create API documentation to your API.
to make the process smooth I created an npm module apigateway-export-tool that does exactly that.
npx apigateway-export-tool list
npx apigateway-export-tool docs -i [api-id] --stageName [stage]
I'm using the aws-sdk module to export the API documentation by api-id and stage-name.
you can also use the module with NodeJS like this:
const { getExportAndSave,setAwsConfig } = require("apigateway-export-tool");
setAwsConfig({ region: "us-east-1" });
(async function() {
const params = {
exportType, // String ("oas30", "swagger")
restApiId, // String
stageName, // String
parameters: {
extensions // String ("postman", "integrations", "integrations", "authorizers")
}
};
const filePath = "./";
const file = await getExportAndSave(params, filePath); //save the file in path.
const file = await getExportAndSave(params); // just returning the file.
})();
after exporting the swagger file go over to https://editor.swagger.io/ and import the file, then you can interact with your API documentation.
in my next post, I will show you my next project to combine the swagger UI with the swagger exporter.