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.
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!
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.
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.
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.
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.
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?
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
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?
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 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"
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.
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.
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!
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.
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.
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.
This was really helpful. Thanks!
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.
This video is just wonderful! Thank you so much!
What was the automatic part exactly?
documentation ui
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?
It's in the video title actually 😂
@@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.
Amazing Job man. Thank you . Keep it up
Nicely explained
thank you
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
Thank you so much 👍🏼🎉🙏⭐
Thank you Tom
thank you so much!
thanks tom!
Thank you for making a wonderful video 👍
This was a great tutorial.
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?
Great video, Thanks a lot. I saw that there is no Authorize button, change securitySchemas to securitySchemes, and it will appear.
This is correct! Thanks for the comment!
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' ??
same here
@@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"
Did you figure this out?
thx
Good Video. Recommend
How to use with JWT ?
why you have called swagger docs function inside app.listen callback?
@types packages should be a dev dependency (e.g. add with `yarn -D @types/swagger-jsdoc`)
Good call
To be honest, this fucks up the whole source code
thats not automatic, you should define each property in comment. its repeatedly writing
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.
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 ;)
Where is jwt?
what switches do you have on your keyboard?
I honestly have no idea
GJ
Tom go sleep.. ;p
haha the video is on a schedule :)
what if we are using an SQL or ORM instead of Mongo? Do the schemas work?
No, you'll need to create schemas that match your orm or database