swagger-jsdoc
JSDoc
swagger-jsdoc | JSDoc | |
---|---|---|
8 | 68 | |
1,642 | 14,762 | |
1.0% | 0.5% | |
1.5 | 9.3 | |
about 1 month ago | 4 days ago | |
JavaScript | JavaScript | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
swagger-jsdoc
-
Best DX to write OpenAPI documentation
For this task, we are going to use swagger-jscode. It says that it is to write Swagger, old name of OpenAPI, inside jsdoc, like below
- How do i document my api ?
-
NodeJS API Documentation
js doc style comments support
-
Automatic swagger ui for nodejs/express? (Info in comments)
There's swagger-ui-express which can work with swagger-jsdoc.
-
Do you use Swagger/OpenAPI to document your APIs? If so, what is your preferred way to generate the docs?
If so, how do you go about generating the interface files? I recently discovered swaggo which generates OpenAPI docs from Go annotations. My Googlefoo then led me to swagger-jsdoc and openapi-comment-parser which do the same thing from JSdoc-like comments. Do you use them, do you use some other module, or do you use some other approach entirely?
-
How do you create API's for front end engineers?
Express by itself lacks a lot of metadata useful for generating OpenAPI spec, you'll end up writing a lot of non-standard doc comments. You want to use something like swagger-jsdoc to generate the spec and then some other package to generate the UI.
-
Adding a Swagger UI page to your Express REST API
This article is a continuation of a series about how to build a REST API in Node.js. In the preceding article of this series we added request and response validation that is based on an OpenAPI spec of the API. We used the swagger-jsdoc package to generate this OpenAPI spec from comments in our code that annotate the REST operations.
-
Adding request and response validation to your Express REST API
The swagger-jsdoc package enables us to do this. It looks for JSDoc comments in code (annotated with an @openapi tag) to generate the OpenAPI specification.
JSDoc
-
Figma's Journey to TypeScript
You may like JSDoc[1] if you just want some type-safety from the IDE without the compilation overhead.
It’s done wonders when I’ve had to wrangle poorly commented legacy JavaScript codebases where most of the overhead is tracing what type the input parameters are.
Personally, I’m impartial to TypeScript or JSDoc at this point. But I’d rather have either over plain JavaScript.
[1] https://jsdoc.app/
-
Eloquent JavaScript 4th edition (2024)
I wholeheartedly agree. At most, I introduce JSDoc[1] to newer developers as standardising how parameters and whatnot are commented at least gets you better documentation and _some_ safety without adding any TS knowledge overhead.
[1] https://jsdoc.app/
-
Learn how to document JavaScript/TypeScript code using JSDoc & Typedoc
This is where JSDoc comes to save the day.
-
Add typing to your Javascript code (without Typescript, kinda) ✍🏼
The best way to do this, of course, is with JSDoc. But something I always found awkward about jsdoc is defining the object types in the same file. So, after a lot of reading, I found a way to combine JSDoc with declaration type files from Typescript. Let me give you an example:
-
What is JSDoc and why you may not need typescript for your next project?
There is a lot of specific symbols presented on the JSDOC specification that can be found here: https://jsdoc.app
-
TypeScript Might Not Be Your God: Case Study of Migration from TS to JSDoc
JSDoc is a specification for the comment format in JavaScript. This specification allows developers to describe the structure of their code, data types, function parameters, and much more using special comments. These comments can then be transformed into documentation using appropriate tools.
-
Adding a search feature to my app
Working with new features, frameworks, and tools, the experience of reading documentation is a critical part of it. I have been lucky to work with projects that feature really easy to read documentation such as USWDS and Bun, but I've also had the misfortune to work with pretty terrible documentation like JSDoc. The JSDoc documentation lacks a search field which makes searching for specific items an ordeal and also does not cover many hidden use cases. It provides less than the bare minimum for what it needs to do - a lot of the time I am forced to rely on external user documentation elsewhere to use JSDoc effectively. That was why I was drawn to the search field in particular in Docusaurus.
-
JavaScript First, Then TypeScript
The Svelte team followed suit but motivated by the maintainer's developer experience as they migrated the project away from TypeScript in favor of plain JSDoc comments for type annotations instead.
-
No comments. Now what?
Even more relevant, tools like Javadoc, JSDoc, Doxygen, etc. read comments in a specific format to generate documentation. These comments do not affect readability. On the contrary, Javadocs are great for explaining how to use these entities. Combined with tools like my dear Doctest, we even get guarantees of accuracy and correctness!
-
The Complete 2023 Guide to Learning TypeScript - From Beginner to Advanced
Document types with JSDoc annotations
What are some alternatives?
swagger-ui-express - Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
ESDoc - ESDoc - Good Documentation for JavaScript
express-openapi-validator - 🦋 Auto-validates api requests, responses, and securities using ExpressJS and an OpenAPI 3.x specification
documentation.js - :book: documentation for modern JavaScript
fastify-openapi-glue - A plugin for the Fastify webserver to autogenerate a Fastify configuration based on a OpenApi(v2/v3) specification.
Docusaurus - Easy to maintain open source documentation websites.
routing-controllers - Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage in Express / Koa using TypeScript and Routing Controllers Framework.
apiDoc - RESTful web API Documentation Generator.
fastify-swagger - Swagger documentation generator for Fastify
YUIDoc - YUI Javascript Documentation Tool
emailengine - Headless email client
storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.