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...
  • НаукаНаука

Комментарии • 120

  • @hastyarazad6179
    @hastyarazad6179 2 года назад +2

    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

  • @joaomatos1144
    @joaomatos1144 3 года назад +5

    2021: Simple and Direct approach, i like it =)

  • @0ne4rif
    @0ne4rif Год назад

    I find this video simple and straightforward, thank you!

  • @dilmurodyangiboev1296
    @dilmurodyangiboev1296 4 года назад +3

    That is what I need on my project. That is great tutorial thank you so much!

  • @simopr09
    @simopr09 4 года назад

    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.

  • @ianlimasouza6896
    @ianlimasouza6896 3 года назад +1

    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)

  • @ganeshprasad6600
    @ganeshprasad6600 3 года назад

    excellant videos - very well explained about swagger, i don't know about swagger and finally learn from this video,

  • @geetaghanti5934
    @geetaghanti5934 3 года назад

    Very useful, just the information I needed.

  • @GautamKumar-nn7bh
    @GautamKumar-nn7bh 2 года назад +1

    This is great information. Thanks for sharing such wonderful information.

  • @ananthpadmakar8240
    @ananthpadmakar8240 3 года назад

    Thank you so much for a quick and easy tutorial. cool.

  • @malayruparel9876
    @malayruparel9876 4 года назад

    Thanks for video. It helped to solve my issue. Well done!

  • @damercadoo
    @damercadoo 4 года назад

    man this tutorial is Gold, thank you very much

    • @ProtikPC_pro_indigo
      @ProtikPC_pro_indigo 4 года назад

      ruclips.net/video/FS0HmgzVcaI/видео.html
      Watch this. A discussion and a high level overview of things.

  • @EduardoMartins-lp7xy
    @EduardoMartins-lp7xy 3 года назад

    Nice tutorial, helped me a lot!! Thank you very much

  • @karinepistili259
    @karinepistili259 3 года назад

    Nice tutorial, helped me a lot! Thank you :)

  • @min5187
    @min5187 3 года назад +1

    This is really useful. Thank you so much!!!!

  • @darkomaksimovic3456
    @darkomaksimovic3456 4 года назад

    Thanks buddy nodejs + express + swagger + docker + visual studio code + chrome + rest .... this video is like goldfish fulfilling desires.

  • @HovhannesGasparyan-ex4el
    @HovhannesGasparyan-ex4el 3 месяца назад

    Thank you for the useful video!

  • @floydfernandes2985
    @floydfernandes2985 3 года назад

    Very Nicely explained.

  • @prvinsharma
    @prvinsharma 4 года назад

    a quick intro to swagger. thanks

  • @mateuspedroso6547
    @mateuspedroso6547 4 года назад

    This was a great tutorial, thanks!!!!

  • @PradeepVish1213
    @PradeepVish1213 2 года назад

    Thanks for your explanation 😊😊

  • @josealvarezcabrera561
    @josealvarezcabrera561 2 года назад

    Amazing tutorial! Thanks.

  • @benjose22
    @benjose22 4 года назад

    Wonderful video. Thank you very much

  • @ngneerin
    @ngneerin 3 года назад +3

    Very good job at the startup tutorial. Would appreciate if there is more in depth tutorial on swagger after this. Thanks.

  • @Matisantillandev
    @Matisantillandev 2 года назад

    Great tutorial, it was very helpful. Thank you! I leave my like here

  • @pnutstube
    @pnutstube Год назад

    Thank you very much for a good tutorial

  • @TinyCoffe
    @TinyCoffe 3 года назад

    great tutorial! thank you very much :)

  • @runyalen
    @runyalen Год назад

    instructive video.. i would recomende to the author of these video to eat more vitamines, sport & better sleep !!

  • @muhammadtarique242
    @muhammadtarique242 2 года назад

    This really helped, Thank you

  • @TheAmeer3881
    @TheAmeer3881 3 года назад

    Very nice . Very clear.

  • @wayne65
    @wayne65 3 года назад

    Thank you. Helpful for me.

  • @Kim-by5uy
    @Kim-by5uy 3 года назад

    Really helpful, thanks

  • @diegolopes1283
    @diegolopes1283 4 года назад +2

    Thank you, broo!

  • @chanu1993
    @chanu1993 3 года назад

    God Video.. I love this. Works well

  • @carloseduardoguedeslourenc4212
    @carloseduardoguedeslourenc4212 4 года назад

    Very cool, man!

  • @raulalejandromunozaraya3878
    @raulalejandromunozaraya3878 4 года назад

    Awesome, thanks a lot!

  • @madhavareddy580
    @madhavareddy580 2 года назад

    Useful. Thanks!

  • @salahed-dineyoumir6605
    @salahed-dineyoumir6605 2 года назад

    very usefull ~ thanks a lot !

  • @leonardoars
    @leonardoars 4 года назад

    Many thanks!

  • @annalopezribo1219
    @annalopezribo1219 2 года назад +3

    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.

  • @mariemmatri8743
    @mariemmatri8743 3 года назад

    Thank you very much!

  • @1N2345
    @1N2345 4 года назад

    basically all i wanted to know ^^

  • @cyberbyron
    @cyberbyron 3 года назад

    Good tutorial :)

  • @msimon4975
    @msimon4975 4 года назад +109

    Change the playback speed to 1.25
    Thank me later.

  • @yassingourkani3856
    @yassingourkani3856 3 года назад

    very useful thankful

  • @mrcyber7073
    @mrcyber7073 4 года назад

    Than you very much !

  • @jovemmestre3456
    @jovemmestre3456 4 года назад +2

    god bless u bro :D

  • @michaeljoshua8908
    @michaeljoshua8908 4 года назад

    Thanks a lot Bro

  • @sagarkharade8535
    @sagarkharade8535 4 года назад

    Thank you bro..!

    • @ProtikPC_pro_indigo
      @ProtikPC_pro_indigo 4 года назад

      ruclips.net/video/FS0HmgzVcaI/видео.html
      Watch this. A discussion and a high level overview of things.

  • @nahbruhwhat
    @nahbruhwhat 4 года назад

    Thanks!

  • @ashwanigaur1828
    @ashwanigaur1828 4 года назад

    Thanks Man..

  • @Hugo.Digital
    @Hugo.Digital 3 года назад

    Thanks a lot

  • @sachinbonde89
    @sachinbonde89 3 года назад

    Nice video

  • @zakariachahboun
    @zakariachahboun 3 года назад

    thanks!

  • @sharonhuaman2874
    @sharonhuaman2874 3 года назад

    Thank u

  • @earthycoin
    @earthycoin 2 года назад

    Thanks

  • @mdk124
    @mdk124 4 года назад +9

    Is there anyway to generate some default documentation without writing the API Documentations (comments/openapi) manually? Like in ASP.NET core?

    • @michalkotlicki4710
      @michalkotlicki4710 4 года назад

      Hey. Did you find out the answer to your question? If yes, can you tell me whether there is a way?

    • @mdk124
      @mdk124 4 года назад

      @@michalkotlicki4710 hey man, unfortunately I did not..

    • @juliosantiesteban7709
      @juliosantiesteban7709 4 года назад

      @@mdk124 a great way to auto generate api docs from comments is jsdoc, but dont know about something so sofisticated as swagger

  • @rbltv
    @rbltv 3 года назад

    top!

  • @andreysholinka5057
    @andreysholinka5057 3 года назад

    how to add authorize button in the top right corner?

  • @nagavadlapudi
    @nagavadlapudi 3 года назад +1

    _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"
    }

  • @madhavareddy580
    @madhavareddy580 2 года назад

    How to document Node Azure functions (serverless) using swagger or any other tool

  • @tscheydee1482
    @tscheydee1482 2 года назад

    Any idea why the docker command doesnt work for me? It says invalid reference format.

  • @harshverm776
    @harshverm776 2 года назад

    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.

  • @shanuruhela
    @shanuruhela 4 года назад

    can you explain how to use header into swagger

  • @volodymyrpliuta3916
    @volodymyrpliuta3916 2 года назад

    should those swagger packages go to devDependencies?

  • @franzmg
    @franzmg 4 года назад

    Hi Brian, I there one option for add swagger annotation to external file such as a router? thanks in advance

    • @faller222
      @faller222 3 года назад

      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

  • @bilkisuismail6096
    @bilkisuismail6096 Год назад

    And what happened to this great instructor, no more videos from him

  • @Siddharth-yi7pg
    @Siddharth-yi7pg 3 года назад

    how to add params in docs?

  • @pushkardeshmukh1987
    @pushkardeshmukh1987 4 года назад +1

    can you please show how to write code for post when i want to pass parameter to the API

    • @deepeshjha7838
      @deepeshjha7838 4 года назад

      Hi Pushkar, did you get a solution? please respond

  • @yadavkishan3778
    @yadavkishan3778 3 года назад +13

    npm i install swagger-jsdoc swagger-ui-express

    • @Bitrey
      @Bitrey 3 года назад

      thanks

  • @whatthefunction9140
    @whatthefunction9140 2 месяца назад

    Hi Bryan 👋

  • @juanjoseordonez8669
    @juanjoseordonez8669 2 года назад

    How can i define the parameters?

  • @ThinKingKaraoke
    @ThinKingKaraoke 2 года назад

    how to use with jwt sir ?

  • @marcella3030
    @marcella3030 4 года назад +14

    My comments about API didn't appear on the generated page, and it doesn't show any error

  • @luisgabrielmxm
    @luisgabrielmxm 4 года назад +2

    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?

    • @NickChlam
      @NickChlam 4 года назад +2

      point to the folder where your routes are - apis: ['./routes/*.js'],

    • @luisgabrielmxm
      @luisgabrielmxm 4 года назад +1

      @@NickChlam thx bro,

    • @franzmg
      @franzmg 4 года назад

      @@NickChlam it doesn't work for me, could somebody help me please?

  • @raulterraferrao696
    @raulterraferrao696 2 года назад

    If do not appear anything, don't forget the '/' before the name of the route.

  • @souravpanda8814
    @souravpanda8814 4 года назад

    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

    • @gabrielfelipenunezjuarez3492
      @gabrielfelipenunezjuarez3492 4 года назад +1

      i had the same error, in my case that was for wrote wrong *swaggerDefinitions* instead of *swaggerDefinition*

  • @GeejayBathan
    @GeejayBathan 4 года назад

    how to add authentication token in swagger?

    • @ProtikPC_pro_indigo
      @ProtikPC_pro_indigo 4 года назад

      ruclips.net/video/FS0HmgzVcaI/видео.html
      Watch this. A discussion and a high level overview of things.

  • @sakshibargal4540
    @sakshibargal4540 3 года назад

    What is documentation?

  • @yjg30737
    @yjg30737 Год назад

    This is more like copy and paste and change slightly.

  • @bonus22
    @bonus22 2 месяца назад

    Your tutorial is very good, but it's definitely is not a auto generated Swagger

  • @shapedthought
    @shapedthought 3 года назад

    Good tutorial but get a better mic!

  • @jeckefe
    @jeckefe 3 года назад

    THIS IS NOT AUTO. BYE

  • @uadev9913
    @uadev9913 2 года назад

    This not Autogenerating! All routs, object you must write!

  • @geekybench
    @geekybench 4 года назад +3

    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.

    • @Alex-vi6fr
      @Alex-vi6fr 4 года назад +9

      you can skip some part, it's not that hard

  • @Tyuvfdhb
    @Tyuvfdhb 3 года назад +2

    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

    • @rubenfernandezsantos5048
      @rubenfernandezsantos5048 3 года назад

      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:

    • @rubenfernandezsantos5048
      @rubenfernandezsantos5048 3 года назад

      const openapiSpecification = await swaggerJsdoc(options);