Automatically Generate Swagger Docs With ExpressJS & NodeJS

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 46

  • @Bateleur90
    @Bateleur90 9 หลายเดือนก่อน +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.

  • @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 ปีที่แล้ว +11

    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 19 วันที่ผ่านมา

      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.

  • @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!

  • @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.

  • @bige2899
    @bige2899 3 หลายเดือนก่อน

    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

  • @erfanexp
    @erfanexp 2 ปีที่แล้ว +47

    What was the automatic part exactly?

    • @ronemchowry180
      @ronemchowry180 ปีที่แล้ว +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 😂

  • @vigilantedevil
    @vigilantedevil ปีที่แล้ว +2

    Amazing Job man. Thank you . Keep it up

  • @majjikishore8689
    @majjikishore8689 ปีที่แล้ว +3

    Nicely explained
    thank you

  • @fresk9139
    @fresk9139 ปีที่แล้ว +3

    This video is just wonderful! Thank you so much!

  •  2 ปีที่แล้ว +3

    This was really helpful. Thanks!

  • @bilkisuismail6096
    @bilkisuismail6096 9 หลายเดือนก่อน +2

    Thank you Tom

  • @uzomanwanne2751
    @uzomanwanne2751 หลายเดือนก่อน

    This was a great tutorial.

  • @rafatanzeem4040
    @rafatanzeem4040 ปีที่แล้ว +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?

  • @riansyahtohamba8215
    @riansyahtohamba8215 2 ปีที่แล้ว +4

    thanks tom!

  • @bektodedic6860
    @bektodedic6860 2 ปีที่แล้ว +5

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

    • @robtangled8816
      @robtangled8816 ปีที่แล้ว

      This is correct! Thanks for the comment!

  • @igormundim
    @igormundim ปีที่แล้ว +3

    thank you so much!

  • @huutamnguyen2529
    @huutamnguyen2529 ปีที่แล้ว +3

    Thank you for making a wonderful video 👍

  • @saurabhchauhan186
    @saurabhchauhan186 7 หลายเดือนก่อน

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

  • @mahendranath2504
    @mahendranath2504 3 ปีที่แล้ว +3

    Thank you so much 👍🏼🎉🙏⭐

  • @activeengineer7974
    @activeengineer7974 10 หลายเดือนก่อน +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 9 หลายเดือนก่อน

      same here

    • @activeengineer7974
      @activeengineer7974 9 หลายเดือนก่อน

      ​@@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 8 หลายเดือนก่อน

      Did you figure this out?

  • @BirgerBurgerBargir
    @BirgerBurgerBargir ปีที่แล้ว

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

  • @ThinKingKaraoke
    @ThinKingKaraoke 2 ปีที่แล้ว +1

    How to use with JWT ?

  • @vaibhavkhunt3837
    @vaibhavkhunt3837 6 หลายเดือนก่อน

    Good Video. Recommend

  • @Yalchin403
    @Yalchin403 11 หลายเดือนก่อน

    To be honest, this fucks up the whole source code

  • @w1nchester551
    @w1nchester551 ปีที่แล้ว +1

    what switches do you have on your keyboard?

    • @TomDoesTech
      @TomDoesTech  ปีที่แล้ว

      I honestly have no idea

  • @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 ;)

  • @luckyardhika3781
    @luckyardhika3781 ปีที่แล้ว +1

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

    • @yajobaby
      @yajobaby 11 หลายเดือนก่อน

      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.

  • @abdelhalim731
    @abdelhalim731 2 ปีที่แล้ว +2

    thx

  • @amit_vyas17
    @amit_vyas17 5 หลายเดือนก่อน

    Where is jwt?

  • @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 10 หลายเดือนก่อน

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

    • @TomDoesTech
      @TomDoesTech  10 หลายเดือนก่อน +1

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