Automatically Generate Swagger Docs With ExpressJS & NodeJS

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 47

  • @Bateleur90
    @Bateleur90 Рік тому +3

    Needed to understand Swagger for work, and this was the first video that popped up, so happy that it was this guy! Normally some obscure old video that pops up.

  • @mashinataFC
    @mashinataFC 3 роки тому +14

    Man, your work is extraordinary. It helped me a lot develop my skills during the past few months i have been watching your videos. Although your channel is not that popular as an advice and for motivation you should definitely continue what you are doing and for sure it will pay off. Regards!

  • @guyswartwood3924
    @guyswartwood3924 Рік тому +4

    I appreciate you taking to the time to produce this video.
    As a cautionary note: the portion of the definition defining securitySchema actually belongs within the definition node of the specs document. It is not outside the definition node as you wrote it. This is why the "Authorize" portion of the UI did not show up in your example.
    Otherwise, thank you for your time and efforts.

  • @CoenNijenhuis1992
    @CoenNijenhuis1992 Рік тому +14

    For anyone trying to use authentication: there is a typo. It should be securitySchemes instead of securitySchemas. You will not receive an error code. The authorize button will just not show up.

    • @twyyre5385
      @twyyre5385 3 місяці тому

      Thank you for this comment. I was actually following another tutorial before coming here and he did the exact same typo. Now the authorize button appears.

  •  2 роки тому +3

    This was really helpful. Thanks!

  • @panthonyy
    @panthonyy 2 роки тому +2

    Mr. TomDoesTech, I'd like to thank you for your work. I've just changed from Spring Boot to TS and express, and your channel is a knowledge gold mine for me! Also, let me tell you that your code is clean and easily readable.

  • @fresk9139
    @fresk9139 2 роки тому +3

    This video is just wonderful! Thank you so much!

  • @erfanexp
    @erfanexp 2 роки тому +48

    What was the automatic part exactly?

    • @ronemchowry180
      @ronemchowry180 2 роки тому +2

      documentation ui

    • @a2xd94
      @a2xd94 Рік тому +3

      If you’re asking that question then you’ve never had to do external-facing documentation before, in which case the real question is : why are you watching this video at all?

    • @md.kawsarali5652
      @md.kawsarali5652 Рік тому +1

      It's in the video title actually 😂

    • @thatsalot3577
      @thatsalot3577 2 місяці тому

      @@a2xd94 yeah but a lot of new frameworks can do most of this stuff for you, it's still not automatic, it's just normal swagger docs.

  • @vigilantedevil
    @vigilantedevil Рік тому +2

    Amazing Job man. Thank you . Keep it up

  • @majjikishore8689
    @majjikishore8689 Рік тому +3

    Nicely explained
    thank you

  • @bige2899
    @bige2899 6 місяців тому +1

    After seeing this , Iam happy that Iam using nestjs it makes my life easy.
    I have to build a simple restapi using express and man this is a nightmate to write all those docs by hand

  • @mahendranath2504
    @mahendranath2504 3 роки тому +3

    Thank you so much 👍🏼🎉🙏⭐

  • @bilkisuismail6096
    @bilkisuismail6096 Рік тому +2

    Thank you Tom

  • @igormundim
    @igormundim Рік тому +3

    thank you so much!

  • @riansyahtohamba8215
    @riansyahtohamba8215 2 роки тому +4

    thanks tom!

  • @huutamnguyen2529
    @huutamnguyen2529 Рік тому +3

    Thank you for making a wonderful video 👍

  • @uzomanwanne2751
    @uzomanwanne2751 3 місяці тому

    This was a great tutorial.

  • @rafatanzeem4040
    @rafatanzeem4040 2 роки тому +3

    Nice video , but I want to how to enable authentication I followed your tutorial but my authentication button is not created also lock icons on each Api are not responding anything , can you please guide me about that?

  • @bektodedic6860
    @bektodedic6860 3 роки тому +5

    Great video, Thanks a lot. I saw that there is no Authorize button, change securitySchemas to securitySchemes, and it will appear.

    • @robtangled8816
      @robtangled8816 2 роки тому

      This is correct! Thanks for the comment!

  • @activeengineer7974
    @activeengineer7974 Рік тому +1

    I didnt understand path for routes. what base it is taking ? According to your folder struct, swagger.ts lies at root-project=>src=>utilts=>swagger.ts ..... while .. .. routes.ts lie at root level of src foler i.e. root-project=>src=>routes.ts .... so, the path should not be like '../routes.ts' ??

    • @bilkisuismail6096
      @bilkisuismail6096 Рік тому

      same here

    • @activeengineer7974
      @activeengineer7974 Рік тому

      ​@@bilkisuismail6096 as per my experience, path starts from the root folder. For example :-
      Project Folder ->
      -node_modules
      -package.json
      -package-lock.json
      -src->
      -routes
      -controllers
      -config->
      -swagger.config.js
      -utils
      -middleware
      -server.js
      Then, the routes path for swagger API will start from the project folder i.e. "./src/routes/*.route.js"

    • @aaishjaved9948
      @aaishjaved9948 11 місяців тому

      Did you figure this out?

  • @abdelhalim731
    @abdelhalim731 2 роки тому +2

    thx

  • @vaibhavkhunt3837
    @vaibhavkhunt3837 9 місяців тому

    Good Video. Recommend

  • @ThinKingKaraoke
    @ThinKingKaraoke 2 роки тому +1

    How to use with JWT ?

  • @saurabhchauhan186
    @saurabhchauhan186 10 місяців тому

    why you have called swagger docs function inside app.listen callback?

  • @BirgerBurgerBargir
    @BirgerBurgerBargir Рік тому

    @types packages should be a dev dependency (e.g. add with `yarn -D @types/swagger-jsdoc`)

  • @Yalchin403
    @Yalchin403 Рік тому

    To be honest, this fucks up the whole source code

  • @luckyardhika3781
    @luckyardhika3781 Рік тому +1

    thats not automatic, you should define each property in comment. its repeatedly writing

    • @yajobaby
      @yajobaby Рік тому

      Yeah kinda misleading I was expecting something like .NET's automatic documentation.
      P.S. if you know a similiar solution for JS/TS that generates automatic documentation without any extra JSDoc/TSDoc please let me know.

  • @edgeeffect
    @edgeeffect Рік тому +2

    You keep hitting semicolon by accident... at the rate you're going you may as well just put them on the ends of your lines. :P ;)

  • @amit_vyas17
    @amit_vyas17 8 місяців тому

    Where is jwt?

  • @w1nchester551
    @w1nchester551 Рік тому +1

    what switches do you have on your keyboard?

  • @hedi_muhammad
    @hedi_muhammad Рік тому +2

    GJ

  • @Snuuspringles
    @Snuuspringles 3 роки тому +1

    Tom go sleep.. ;p

    • @TomDoesTech
      @TomDoesTech  3 роки тому +2

      haha the video is on a schedule :)

  • @worldwide6626
    @worldwide6626 Рік тому

    what if we are using an SQL or ORM instead of Mongo? Do the schemas work?

    • @TomDoesTech
      @TomDoesTech  Рік тому +1

      No, you'll need to create schemas that match your orm or database