Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Next.js with Swagger

Is there a way to have a swagger documentation for NEXT.js API routes? I'm using Next.js for both front-end and back-end development and I want to have a swagger documentation for the APIs I develop with Next.js.

like image 241
Ehsan Shekari Avatar asked Apr 05 '21 15:04

Ehsan Shekari


People also ask

Is swagger deprecated?

The Swagger API interface in the AppDynamics Platform is deprecated starting version 4.5. 15.

What is the replacement of swagger?

Postman, Apiary, Gitbook, jsdoc, and Docusaurus are the most popular alternatives and competitors to Swagger UI.

What is swagger in nest JS?

Swagger is a free, open-source framework for creating interactive and user-friendly API documentation. It generates interactive web pages that allow you to test an API with various inputs. Swagger supports both JSON and XML payloads. The documentation it generates is suitable for developers and non-developers to use.

Is swagger front end?

Swagger used to consist of the specification and a large ecosystem of tools to implement the specification. These tools include everything from front-end user interfaces, low-level code libraries and commercial API management solutions.


1 Answers

I made a little npm library that auto-generates Swagger docs from your NextJS project. No user input needed!

Still very Beta but hope it's useful. https://www.npmjs.com/package/nextjs-routes-docs

Just run

npx nextjs-routes-docs [dir]
like image 185
Tedis Agolli Avatar answered Oct 20 '22 00:10

Tedis Agolli