Autogenerating Swagger Documentation with Node & Express
HTML-код
- Опубликовано: 4 июл 2024
- In this video we walk through creating a simple NodeJS/Express API endpoint and setting auto-generating documentation using Swagger. We can then test our API using the Swagger UI.
Code: github.com/brian-childress/no... Наука
I have been searching around for almost 10 hours looking at different tutorials and articles. Nether one of them explained and demonstrated it like you. A verry BIG THANK YOUUU!!!. Keep up the good work
2021: Simple and Direct approach, i like it =)
I find this video simple and straightforward, thank you!
That is what I need on my project. That is great tutorial thank you so much!
I have got to leave a comment at 6k views. This video will get soon A LOT of views!
Thank sir! You are a great instructor. Clear and concise.
115k views now. Your foresight>>>>>
Thanks a lot for this, even the mistake with the put (customerS) at the end helped me understand it better haha great video!
NOTE: this also works without Docker for people who are unfamiliar to it (like me)
excellant videos - very well explained about swagger, i don't know about swagger and finally learn from this video,
Very useful, just the information I needed.
This is great information. Thanks for sharing such wonderful information.
Thank you so much for a quick and easy tutorial. cool.
Thanks for video. It helped to solve my issue. Well done!
man this tutorial is Gold, thank you very much
ruclips.net/video/FS0HmgzVcaI/видео.html
Watch this. A discussion and a high level overview of things.
Nice tutorial, helped me a lot!! Thank you very much
Nice tutorial, helped me a lot! Thank you :)
This is really useful. Thank you so much!!!!
Thanks buddy nodejs + express + swagger + docker + visual studio code + chrome + rest .... this video is like goldfish fulfilling desires.
Thank you for the useful video!
Very Nicely explained.
a quick intro to swagger. thanks
This was a great tutorial, thanks!!!!
Thanks for your explanation 😊😊
Amazing tutorial! Thanks.
Wonderful video. Thank you very much
Very good job at the startup tutorial. Would appreciate if there is more in depth tutorial on swagger after this. Thanks.
Great tutorial, it was very helpful. Thank you! I leave my like here
Thank you very much for a good tutorial
great tutorial! thank you very much :)
instructive video.. i would recomende to the author of these video to eat more vitamines, sport & better sleep !!
This really helped, Thank you
Very nice . Very clear.
Thank you. Helpful for me.
Really helpful, thanks
Thank you, broo!
God Video.. I love this. Works well
Very cool, man!
Awesome, thanks a lot!
Useful. Thanks!
very usefull ~ thanks a lot !
Many thanks!
This video was very instructive, thanks! But I decided to stick to the traditional way of documenting swagger routes. For me it looks more complicated this way, when autogenerating swagger routes it's tricky to have every mongoose schema as well in the docs, and the routes are not organized, also, visually it looks kinda messy to have all that written code for each endpoint in all my routes. I know that there are npm packages that help you with the schemas like "mongoose-to-swagger", but in the end it looks to me like an extra work and not like an automated process at all.
Thank you very much!
basically all i wanted to know ^^
Good tutorial :)
Change the playback speed to 1.25
Thank me later.
Not all heroes wear caps
More like playback speed: 2
Thank you
right arrow key is my best friend
very useful thankful
Than you very much !
god bless u bro :D
Thanks a lot Bro
Thank you bro..!
ruclips.net/video/FS0HmgzVcaI/видео.html
Watch this. A discussion and a high level overview of things.
Thanks!
Thanks Man..
Thanks a lot
Nice video
thanks!
Thank u
Thanks
Is there anyway to generate some default documentation without writing the API Documentations (comments/openapi) manually? Like in ASP.NET core?
Hey. Did you find out the answer to your question? If yes, can you tell me whether there is a way?
@@michalkotlicki4710 hey man, unfortunately I did not..
@@mdk124 a great way to auto generate api docs from comments is jsdoc, but dont know about something so sofisticated as swagger
top!
how to add authorize button in the top right corner?
_Issue I faced_
node_modules\swagger-jsdoc\index.js:1
import { prepare, extract, organize, finalize } from './src/specification.js';
Error: Unexpected token {
_Resolution that worked for me_
Following config on *package.json* worked
"devDependencies": {
"swagger-jsdoc": "6.0.0",
"swagger-ui-express": "^4.1.6"
}
How to document Node Azure functions (serverless) using swagger or any other tool
Any idea why the docker command doesnt work for me? It says invalid reference format.
Can't we generate them direct?
I spring boot we just need to add swagger dependency and everything will be automatically come of the swagger page.
can you explain how to use header into swagger
should those swagger packages go to devDependencies?
Hi Brian, I there one option for add swagger annotation to external file such as a router? thanks in advance
no entendi lo que preguntaste pero en la variable SwaggerDeffinition viste que pone un valor en apis, el cual es un array.
Bueno ahi podes referenciar todos los Js que quieras, si vos tenes tu api en otro lado, podrias agragar ahi el archivo y asi incluirlo tambin,
De hecho en mi caso, pongo la definicion de los schemas en cada clase, y las rutas en el router, y queda todo junto a lfinal, lo unico que hay que hacer usar los #ref que podes ver en la doc de swagger
And what happened to this great instructor, no more videos from him
how to add params in docs?
can you please show how to write code for post when i want to pass parameter to the API
Hi Pushkar, did you get a solution? please respond
npm i install swagger-jsdoc swagger-ui-express
thanks
Hi Bryan 👋
How can i define the parameters?
how to use with jwt sir ?
My comments about API didn't appear on the generated page, and it doesn't show any error
you can resolve?
I have same problem!
I have the same issue
same
You have to make sure that the "apis" property of the "swaggerDefinition" object is correct for wherever your comments are. (app.js in the video mine is ./server.js for absolute location. )
Hi bro, I'm using MVC architecture and I'm having trouble configuring, swagger can't find the routes to generate the documentation, could you save me?
point to the folder where your routes are - apis: ['./routes/*.js'],
@@NickChlam thx bro,
@@NickChlam it doesn't work for me, could somebody help me please?
If do not appear anything, don't forget the '/' before the name of the route.
Hi. It's a wonderul video. But, when I am installing js-doc why it's showing error. Unexpected token u at node_modules/swagger-jsdcoc/lib/index.js
i had the same error, in my case that was for wrote wrong *swaggerDefinitions* instead of *swaggerDefinition*
how to add authentication token in swagger?
ruclips.net/video/FS0HmgzVcaI/видео.html
Watch this. A discussion and a high level overview of things.
What is documentation?
This is more like copy and paste and change slightly.
Your tutorial is very good, but it's definitely is not a auto generated Swagger
Good tutorial but get a better mic!
THIS IS NOT AUTO. BYE
This not Autogenerating! All routs, object you must write!
3 minutes in and still haven't touched swagger. Dude we don't need to know why we need to document our code, we don't need to learn how to initialise a new npm project, we don't need to know how to create a new express API. Just show us what you've stated in the title. Autogenerating swagger documentation using an express api. This video could have been 5 minutes long.
you can skip some part, it's not that hard
Thanks for the tutorial. I was unable to use swagger-jsdoc@7x (node14x) since it requires import instead of "require". The easiest solution was to use swagger-jsdoc@6x
In theory, imports can be used with swagger-jsdoc 7. I checked the documentation the documentation here www.npmjs.com/package/swagger-jsdoc and now it's necessary to use "await" when we passed the options to swaggerJsdoc as follows:
const openapiSpecification = await swaggerJsdoc(options);