REST API Documentation using Swagger2 in Spring Boot | Tech Primers

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

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

  • @ItamarLev
    @ItamarLev 6 лет назад +7

    great tutorial! after days and days of looking for a good explanation you did it in less than half an hour. thank you!

  • @rohitkr.maurya6917
    @rohitkr.maurya6917 5 лет назад +5

    Your video is like any beginner can easily understand....Thanks for your effort

  • @muks
    @muks 6 лет назад +9

    Dude,
    Few points
    1. The background is really awesome,
    2. I really learned some good stuff although I know swagger2,
    3. You need to explain in the swaggerConfig what is regex and how did you coded for it? because default paths only accepts the PathSelectors,
    4. Some of the attributes have changed For e.g. description for @Api OR ApiInfo constructor args have changed but i guess you are unable to update the videos which is understood considering the vast no. of videos you are making,
    5. Hands down very good videos for anybody to keep learning.
    Thanks a lot.

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

    Thanks for the tutorial, my rest api just accepts query parameter i.e ?param = value, so I don't want swagger to ask for any parameters, how can I do that.. Plz help

  • @sateeshkumar-sy2pc
    @sateeshkumar-sy2pc 6 лет назад +4

    Explained in a very simple way. Tried once and executed. That's all....
    Thank you...

  • @andrzejokon1517
    @andrzejokon1517 6 лет назад +3

    I use all technologies you talk about in your videos:) Great tutorial. Thank you.

  • @muzammilsiddique2821
    @muzammilsiddique2821 6 лет назад +2

    This session is a great learning guide for generating API documentation from Spring boot project. Please plan a session on building API documentation from swagger editor and then build an API based on that documentation

  • @maxlimgj
    @maxlimgj 5 лет назад +3

    Awesome explaination! Looking forward to more content

  • @suddewar
    @suddewar 5 лет назад +2

    Explained in very clean and precise way. Thanks

  • @StefanBanu
    @StefanBanu 7 лет назад +1

    Hi, what plugin was that automatic import in pom.xml when you just typed swaggerDependency? Or what was that?how can i type directly the name of the dependency in pom.xml?
    thank you,

  • @VIGNESHRUpendiran
    @VIGNESHRUpendiran 7 лет назад +1

    Wow,you again proveed buddy,i learned new things from u...I gave u thumpsup..Keep rocking...

    • @TechPrimers
      @TechPrimers  7 лет назад

      +VIGNESH R thank you Vignesh.
      Happy Learning

  • @EnterpriseArchitect01
    @EnterpriseArchitect01 5 лет назад

    I'am looking out to create Microservices documentation very similar to 'Rapid API ' i,e with get/post methods, Resource URI and testing approach with API key . Any idea, how to create such documentation ? Thanks in Advance

  • @kev18284
    @kev18284 5 лет назад +4

    Very clean and precise tutorial!

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

    Great tutorial, thanks !! How can we pass custom header through the Swagger. Is it possible?

  • @78tomke
    @78tomke 6 лет назад +2

    Thanks, mate. It was a pleasure to watch it. Excellent job very informative ;)

  • @photo_lab4095
    @photo_lab4095 6 лет назад +1

    Great Tech Primers good job please make more video on Rest Webservices with Spring Rest WebServices

    • @TechPrimers
      @TechPrimers  6 лет назад

      sure ramjeet. any specific usecase you want me to cover?

    • @photo_lab4095
      @photo_lab4095 6 лет назад

      Recently I attend one interview he asked me to represet the EntityEndPoint in Rest API but I didn't get the question it self so I want to learn besic Rest Full or Spring Rest webservice with example. & Thanks for response.

    • @TechPrimers
      @TechPrimers  6 лет назад

      EntityEndPoint is the Endpoint exposing your entity(eg Users).

  • @nikhilnr6392
    @nikhilnr6392 6 лет назад +1

    Great video !! very informative !! One quick question - I am working on adding Swagger documentation on REST Services developed by somebody else. This REST API does not have @RequestBody annotation for the Request object. When I add @RequestBody to the Request API, the API is breaking. Therefore, how can I include the REQUEST PARAMETERS in the Swagger documentation without adding @RequestBody ?

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

    simple and nice explanation step by step

  • @parasbishwakarma5737
    @parasbishwakarma5737 6 лет назад +2

    Great Video .. I have one question that is if the application is using security like spring security then how the swagger authorize users. Please Suggest.

    • @TechPrimers
      @TechPrimers  6 лет назад +1

      Swagger will internally use the secured API, so it still will use Spring Security and you wil have to set headers in the browser using REST clients

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

    I am using Jersey with spring boot, I think I am getting error : bean creation failed. Do I have to do anything diffrent in this scenario. Thanks!

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

    I tried using @ApiModelProperty for the complex objects in the response but it is working only for those objects which are coming as response in the form of a list but not in case of a standalone object.
    In the below example "List of ObejctA" is documented is Swagger but "Stand alone Object B" is not getting documented.
    e.g.
    @ApiModelProperty(notes="List of ObjectA")
    public List getObjectA()
    {.
    .
    .
    }
    @ApiModelProperty(notes="Stand alone Object B")
    public ObjectB getObjectB()
    {.......}
    What to do ?

  • @gundamaiahannamaina9273
    @gundamaiahannamaina9273 5 лет назад +2

    Nice tutorial. Instead of placing annotations in resource classes. We can create interface and place all api annotations on top of the methods in interface
    And implement that interface in the resource. Is this a good way of implementating swagger in separate interfaces ?

  • @sathishrao7926
    @sathishrao7926 5 лет назад

    Quite a comprehensive information through good explanation..

  • @balakajendran1
    @balakajendran1 5 лет назад +1

    I was downloaded source from github and imported as maven project in STS tool. The Swagger UI page loading but Rest API details not shown. Can you please help me to resolve this issue.. Anything I have to do specifically for STS tool?

    • @praveenambati7804
      @praveenambati7804 5 лет назад

      facing same issue, have you fixed it already ?

    • @balakajendran1
      @balakajendran1 5 лет назад

      @@praveenambati7804 Download github code from this video and try it.

    • @praveenambati7804
      @praveenambati7804 5 лет назад

      @@balakajendran1 Thank You for your reply, I found another way to work on Swagger2. it's working now.

  • @kunupat
    @kunupat 5 лет назад

    Good video. I have a question: if we have a set of REST microservices each running as a separate Spring boot app ( a maven project running inside docker) and if we have enabled swagger docs for each of the service, is there any way to consolidate swagger documentation of all services under one swagger UI URL?

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

    This is a great video....I also have a question here.... Can I configure my code so that it will also general Yaml file for the swagger,.... I'll use that YAML in the swagger hub and can give it to the testing team while my application runs in the cloud...

    • @ManishKumar-lg9gt
      @ManishKumar-lg9gt 2 года назад

      Hi Vishal, I have the same requirement. Can you tell me, did you find any solution for this?

  • @nitsbobby
    @nitsbobby 6 лет назад +1

    Good Video and very easy to understand. Thanks for this tutorial. Thanks Bro.

  • @asmatsoomro7675
    @asmatsoomro7675 5 лет назад

    Hey the video was very helpful. I have one question though. How can we generate a yaml file from a swagger UI for your API?

  • @ramstube08
    @ramstube08 5 лет назад +1

    It's very detailed and very good. Thanks much for the video. Can you please tell me how to hit that request URL with a java program. If you can guide me to any other resource is also good..

    • @TechPrimers
      @TechPrimers  5 лет назад

      you can try googling for RestTemplate. using rest template you can hit the urls programmatically

  • @fsocietyearth9091
    @fsocietyearth9091 5 лет назад

    Just wondering, if you are coding and documenting both by yourself, then what tech writers are doing in your company?? I think this is part of tech writers

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

    Hi TechPrimers, I followed the same steps but when I try to access localhost:8080/swagger-ui.html it says 404 error. Any idea?

  • @amberkumar2359
    @amberkumar2359 5 лет назад

    Can you please suggest a way to access LDAP secured api with swagger2?

  • @SurendraJayswal
    @SurendraJayswal 5 лет назад

    hi, I need to create a dropdown and based on selected value, show a different table of data. can you help?

  • @krishnamr6608
    @krishnamr6608 6 лет назад +1

    Great Video. Simple and good. Keep doing.

  • @praveenambati7804
    @praveenambati7804 5 лет назад

    localhost:8889/swagger-ui.html# doesn't showing any resource ..verified basepackage in SwaggerConfig seems fine according to my package names. can you please help how to fix this issue ? FYI, I followed same example

  • @mohamedgoher9727
    @mohamedgoher9727 5 лет назад +1

    The video is neat and untidy

  • @yogeshchaudhari9971
    @yogeshchaudhari9971 5 лет назад +2

    amazing knowledgeable video... thank you so much

  • @ILyaCyclone
    @ILyaCyclone 5 лет назад

    You've added 200 "Successful Hello World" at 18:13, but why it isn't in the doc at 18:52?

  • @zishan-khan
    @zishan-khan 4 года назад

    hi,
    how can we send jwt token with the help of swagger for authentication?

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

    nice and it's very clear video, Thanks a lot :-)

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

    Thank you ..very informative and detailed one indeed

  • @anilpatil5882
    @anilpatil5882 6 лет назад +4

    please upload videos which contains spring boot and jpa integration with curd/crud operation

    • @TechPrimers
      @TechPrimers  6 лет назад +1

      Hi Anil, take a look at the spring boot Playlist. I have done it with Spring Data JPA examples

  • @Gabs__00
    @Gabs__00 7 лет назад

    Thank you so much from Brazil, your video help me a lot of

    • @TechPrimers
      @TechPrimers  7 лет назад

      +Gabriel Tavares my pleasure Gabriel

  • @Premkumar-ln7gt
    @Premkumar-ln7gt 5 лет назад

    simple and easy....thanks sir ji..

  • @Vihaanhyperboy200
    @Vihaanhyperboy200 5 лет назад

    Another awesome video from TechPrimers. Thank you. We have implemented our REST services with OAUTH2. How to test those services from Swagger UI. I could not find much resources on it.

    • @TechPrimers
      @TechPrimers  5 лет назад

      Swagger UI is just for getting documentation out of the exposed REST endpoints. you can use CURL to trigger REST calls for automated testing.

  • @busbusvlog
    @busbusvlog 5 лет назад +2

    Thank you for the video. It helped me a lot :)

  • @nikhilka9584
    @nikhilka9584 5 лет назад

    Nicely explained.
    How can we set api headers in swagger ?

  • @Rishi_Ventrapati
    @Rishi_Ventrapati 6 лет назад +1

    Good information for beginners. Grate video

  • @bhubannayak6155
    @bhubannayak6155 5 лет назад +1

    Hi very informative video but can I have multiple registration of rest applications in one swagger UI ?

    • @TechPrimers
      @TechPrimers  5 лет назад

      at this point you cannot

    • @TechPrimers
      @TechPrimers  5 лет назад

      you have to leverage on API Gateways like APIGee

  • @Almost2333
    @Almost2333 6 лет назад +2

    Enter swaggerConfig and the autofill. Is Plugin?
    I installed Swagger Plugin from IDEA, but it is invalid.
    English is not my native language; please excuse typing errors.

    • @TechPrimers
      @TechPrimers  6 лет назад +1

      its called Live Template. I have added those texts before hand so that it can paste the code wherever i need

    • @Almost2333
      @Almost2333 6 лет назад

      Thanks :)

  • @kodosaru
    @kodosaru 5 лет назад +2

    Nice tutorial. Thank you!

  • @sayitlikeitis1202
    @sayitlikeitis1202 6 лет назад

    Good videos from this company. Excepting that the BACKGROUND MUSIC is extremely ANNOYING !!! . Tell me is there any other website that explains concepts with movie like background ?

  • @abinashdas5222
    @abinashdas5222 5 лет назад

    How do we disable tryout and authorize options in the swagger ui?

  • @aneksingh4496
    @aneksingh4496 5 лет назад +1

    Nicely explained ....can u please make videos on Rx spring

  • @shivampatil5709
    @shivampatil5709 5 лет назад

    video is good as well as backgroung score.

  • @vndprasadgrandhi7024
    @vndprasadgrandhi7024 Год назад +1

    Excellent..thanks

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

    Bro i did the same as u suggest but the swagger ui dashboard is not opening , its showing 403 status??
    Anyone plz help???
    👆🏻

  • @balakrishnagajam
    @balakrishnagajam 5 лет назад +1

    Great job dude

  • @balrajmys
    @balrajmys 7 лет назад +1

    Awesome video :) great job :) very informative

  • @photo_lab4095
    @photo_lab4095 5 лет назад

    how we can add swagger ui authentication with out any credential please make one videos on this topic

  • @irshadb6587
    @irshadb6587 7 лет назад +1

    There is another option of writing the swagger yml file and generate the code from it. Could you elaborate on that too? Thanks

  • @isidronavea7363
    @isidronavea7363 5 лет назад +1

    Nice tutorial!

  • @gmsvgm
    @gmsvgm 6 лет назад

    We need to develop multiple micro services and so wanted to know if we can have separate swagger ui where documentation of all these micro services can be obtained in single shot. Please respond asap

    • @TechPrimers
      @TechPrimers  6 лет назад

      you cannot do that for all microservices in one place. It can be done only at individual service level

    • @gmsvgm
      @gmsvgm 6 лет назад

      Tech Primers ok
      Can I read the swagger json from all my services and call it from a single place??

  • @jribkr8501
    @jribkr8501 6 лет назад

    I would appreciate if I can get answers to the following questions:
    Why do you use Springfox?
    What would I have to do if I want to use core swagger libraries?
    How does it work at a higher level?
    Somehow everyone is eager to use Springfox. Is there a specific path where swagger docs would be generated? Is there a way to customize the path where you want to generate the doc?

  • @vipinahuja6096
    @vipinahuja6096 7 лет назад +2

    Nice video :) .. I have one question -> Can I catch response from swagger and use in my java code. e.g: if I receive successful response Swagger should show some message and give me link do u want to go next request.
    Thanks in advance :) .

    • @TechPrimers
      @TechPrimers  7 лет назад

      HI Vipin,
      Swagger is used only as a documentation tool, we should not use it for controlling workflow using UI.
      You can get the response and use it in java code, but showing message and giving link for going to next request is an overkill.

    • @vipinahuja6096
      @vipinahuja6096 7 лет назад

      +Tech Primers thanks a lot for reply. Got it

    • @chrispie5
      @chrispie5 6 лет назад

      @@vipinahuja6096 I think what you looking for is a rest concept called hateoas. Whereby the rest service is giving you a response of the next available options

  • @victorlangat856
    @victorlangat856 5 лет назад +1

    a wonderful one here

  • @RISHABHJAIN4
    @RISHABHJAIN4 6 лет назад

    Can I get this documentation offline, i.e, when my service is not running then also one could read the Docs ??

    • @TechPrimers
      @TechPrimers  6 лет назад

      you will have to host it somewhere or the other. At max, you can download the html page.

  • @sathishkumar-qf6xb
    @sathishkumar-qf6xb 6 лет назад +1

    Thanks dude .very informative

  • @saktiranjanbehera7010
    @saktiranjanbehera7010 5 лет назад

    I am not able to import regex.Could you help me out.

  • @anushaanu9619
    @anushaanu9619 5 лет назад +1

    I have followed all steps,but I'm getting whitelable error,in chrome,and 404 error in console,please answer this,I'm new to spring boot

    • @ILyaCyclone
      @ILyaCyclone 5 лет назад

      This is Spring Boot 1.5.6 video and it is 2.1.* nowadays - a lot could change, e.g. URL of the UI. Check official docs.

  • @sun-prairie
    @sun-prairie 7 лет назад +1

    Very useful. Thank you!

    • @TechPrimers
      @TechPrimers  7 лет назад

      +ennore82 glad that was useful

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

    super sirrr

  • @GlebKuzntesov
    @GlebKuzntesov 6 лет назад +1

    Great video!

  • @GauravSharma-wb9se
    @GauravSharma-wb9se 4 года назад +1

    how user will know request structure ?....can't it show sample request structure ?

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

      Yes it does show. When you click on each endpoint it shows the structure

  • @vijaykumar-gq7bm
    @vijaykumar-gq7bm 2 года назад

    @Tech Primers
    Please Explain how to Solve This Problem...I Tried So Many Solutions From Google,Stackoverflow etc But Still Error Not Fixed...
    Can You Please Respond Bro
    Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()" because the return value of "springfox.documentation.spi.service.contexts.Orderings.patternsCondition(springfox.documentation.RequestHandler)" is null
    at springfox.documentation.spi.service.contexts.Orderings$8.compare(Orderings.java:112) ~[springfox-spi-2.6.1.jar:null]

  • @gopalbarge4961
    @gopalbarge4961 7 лет назад +1

    Simply awesome

  • @akhandpratapsingh1527
    @akhandpratapsingh1527 6 лет назад +2

    Thanks a lot, Man.

  • @virtexamit
    @virtexamit 7 лет назад +1

    Nice work !!

  • @vidyasagarareddy6118
    @vidyasagarareddy6118 5 лет назад

    @Tech primers,
    How are you getting the license for free the Intellij, I can see on their site, it is very costly.

    • @TechPrimers
      @TechPrimers  5 лет назад

      Use Community edition. It's free

  • @RetheeshSoman
    @RetheeshSoman 6 лет назад +2

    Great. Thanks a lot

  • @srinusrinivas6101
    @srinusrinivas6101 5 лет назад +1

    Thankyou helped me a lot

  • @nirvanjain3021
    @nirvanjain3021 5 лет назад

    Liked Video
    Use something different every time other than Hello World
    It confuses first timers

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

    How to send excel in response using swagger and springboot?

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

      You have to send the right headers for attachment of your csv from spring boot

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

      @@TechPrimers Thanks a lot for your reply. But the thing is what should be the typreof ResponseEntity, Will it be InputStream? If so, then how can I define InputStream in the swagger json?

  • @vbnandu867
    @vbnandu867 6 лет назад

    what about the response model?

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

    thank you!!!

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

      Glad it was helpful 👍🏻

  • @ccccljk
    @ccccljk 6 лет назад

    i can't run app in source code in eclipse, please help me

  • @amityadav-bj9no
    @amityadav-bj9no 4 года назад +1

    Thank you!!

  • @abhilashsulibela1414
    @abhilashsulibela1414 6 лет назад +1

    This is awesome! Thanks (y)

  • @neekhilverma9560
    @neekhilverma9560 6 лет назад

    Sir,
    Please show a example for the integration of swagger and mongoDB in spring framework

    • @TechPrimers
      @TechPrimers  6 лет назад

      i have separate video on mongo. you can merge them both

    • @neekhilverma9560
      @neekhilverma9560 6 лет назад

      @@TechPrimers ok sir
      I will try to merge them . Thank you 😊

  • @chinmaykrovvidi8519
    @chinmaykrovvidi8519 6 лет назад

    So you cannot override 200 Message ?

  • @AbhishekSagar-kf8fy
    @AbhishekSagar-kf8fy 7 лет назад

    Awesome
    can you please make on video on debugging microservices examale

    • @TechPrimers
      @TechPrimers  7 лет назад

      +Abhishek Sagar Sure

    • @subash961
      @subash961 7 лет назад

      I have question, Can i use swagger2 for spring MVC also? or only support spring boot?

  • @vipinsamleti8294
    @vipinsamleti8294 7 лет назад

    Where is the swagger-ui.html file will store?
    Can we customize swagger-ui.html ?

    • @TechPrimers
      @TechPrimers  7 лет назад

      +Vipin Samleti hi Vipin, it's generated under the sources. You can use the relevant annotations to modify it

    • @vipinsamleti8294
      @vipinsamleti8294 7 лет назад

      +Tech Primers, I have searched in my workspace under webapp folder, there is no any file generated. should we write any annotation to generate the file?

    • @TechPrimers
      @TechPrimers  7 лет назад

      +Vipin Samleti it should be in your target folder

  • @sathishprithiviraj9756
    @sathishprithiviraj9756 6 лет назад +1

    Awesome video :)

  • @melsaied101
    @melsaied101 6 лет назад +2

    Thank you for you effort

  • @rohitkolar5076
    @rohitkolar5076 6 лет назад

    what is the name of that sound you are playing in intro

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

    thanks youuu

  • @laxbabuchintala6937
    @laxbabuchintala6937 6 лет назад +1

    Good video

  • @vikashyadav-nr4my
    @vikashyadav-nr4my 6 лет назад

    Thank you very much for this video..could you pls add video on how to add headers in swagger as well.Thanks

  • @saktiranjanbehera7010
    @saktiranjanbehera7010 5 лет назад +1

    Thank you

  • @dssomething8516
    @dssomething8516 6 лет назад

    How we can deploy war file into tomcat. Make a video for it.

    • @TechPrimers
      @TechPrimers  6 лет назад

      HI DS, there are lots of good videos in RUclips already for that

    • @dssomething8516
      @dssomething8516 6 лет назад

      Tech Primers thanks for reply I have faced a issue that is resolved :)