Rest/Restful Api Interview Questions and Answers | Part 2| Swagger Spring boot tutorial |Code Decode

Поділитися
Вставка
  • Опубліковано 8 жов 2024
  • In this video code decode have explained rest api interview questions for experienced candidate along with swagger implementation.
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/u...
    Course Description Video :
    yt.openinapp.c...
    Rest Api part 2 : • Restful API Web Servic...
    How Do you share REST API contracts you created with Front end team?
    There are multiple ways to share the created Rest API contract with front end or any other backend team who wants to access your service.
    You can share the CURL from postman.
    Best practice is to Implement the Swagger and configure it in such a way that as soon as you start your server the APIs must be automatically documented in Swagger UI.
    What is SWAGGER
    Documentation From Your API Design
    As your project grows with the time, The number of rest end points to fulfilment new functionalities also increases. And so does the headache of maintaining API docs
    Swagger tools takes the hard work out of generating and maintaining your API docs, ensuring your documentation stays up-to-date as your API evolves.
    For existing APIs: Documentation can be auto-generated from an API definition.
    For new APIs - on startup that too will be auto generated.
    You can maintain multiple versions too.
    What is SWAGGER UI
    Swagger UI allows
    Developers
    Front end team members
    Other Service users who calls your Rest endpoints for some data / functionality
    to visualize and interact with the API’s resources without having any of the implementation logic in place
    Understanding Code
    @EnableSwagger2 - Enables Springfox swagger 2
    return new Docket(DocumentationType.SWAGGER_2) - Springfox’s, primary api configuration mechanism is initialized for swagger specification 2.0
    groupName("public-api") - Docket helps configure a subset of the services to be documented and groups them by name. Like - public-api , private-apis, business-api, admin-specific-apis
    apiInfo(apiInfo()) - return ApiInfoBuilder - Builds the api information - like title, description, version, license etc.
    select() - select() returns an instance of ApiSelectorBuilder to give fine grained control over the endpoints exposed via swagger.
    apis() allows selection of RequestHandler's using a predicate. The example here uses an any predicate (default). Out of the box predicates provided are any, none, withClassAnnotation, withMethodAnnotation and basePackage.
    Steps used - Summarize
    add dependency in POM file in Rest API demo project
    Add swagger config file in Rest API demo project
    3) Hit :
    localhost:8080/swagger-ui.html#/
    4) now u see
    Basic error controller :
    configure Swagger in a Spring Boot application to hide paths exposed by the BasicErrorController.
    solutions'
    1) 4.1. Exclude with basePackage()
    //.apis(RequestHandlerSelectors.basePackage("com.codedecode.demo.controller"))
    2) I think, the most elegant solution is to include only @RestController controllers into swagger, only thing to bear in mind, is to annotate all the REST controllers with that annotation:
    .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
    As BasicErrorController is annotated with @Controller only, swagger would avoid BasicErrorController in definition file in Rest APi demo project
    Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
    Advance Java Interview Questions and Answers : • Advance Java Interview...
    Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers : • Advance Java Interview...
    Angular Playlist : • Angular Course Introdu...
    SQL Playlist : • SQL Interview Question...
    GIT : • GIT
    Subscriber and Follow Code Decode
    Subscriber Code Decode : www.youtube.co...
    LinkedIn : / codedecodeyoutube
    Instagram : / codedecode25
    #restapi #codedecode #swaggerrestapi

КОМЕНТАРІ • 93

  • @043_cse_k.jayalakshmi7
    @043_cse_k.jayalakshmi7 7 місяців тому +3

    You are such an angel ♥️🥺
    These are the best contents which my seniors in office hesitated to teach ✨ very grateful dor for your work. Love you. I am following your videos to crack top companies. ✨

  • @johnnybreathe
    @johnnybreathe 2 роки тому +10

    Wow that was a surprise for me to learn swagger while just glancing rest. I have tried learning it through some websites before but this was easily explained. Thanks for spreading the knowledge. Just wow 🧑‍💻 😳🤗

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

      Haha glad to hear that 🙂 thanks a lot 🙂🙂things are really that easy, our task is to make it easy n present it to u 👍👍🙂🙂

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

    Nice explanation with short n sweet code...all swagger become easy within 5 min .....great video

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

      Glad to hear that Ravi 🙂👍👍🙂

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

    Thanks for such an easy tutorial...u just made me understand swagger in just few minutes..

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

      🙂🙂things are that simple here Swapnil. Either we are just afraid to start it or we fear we might not complete it successfully 🙂

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

      Liked your video. I was trying to get some information on Rest Api Library . @@CodeDecode

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

    Thank you for sharing useful videos, Code Decode is a Next leval.........Thank you

  • @kartikRavat-i8y
    @kartikRavat-i8y Рік тому +1

    It was very helpful , please add similar content , thank you

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

    Really great explanation very straight forward points in your Video Thank you 🙂👌

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

    Thank you for all hard work you do!! Please create some videos on mockito and testing.. thanks

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

      sure bhavik we will create it soon

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

    Thank you so much mam. Great tutorials. Explained in a great n easy way

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

    Hi, thank you for your videos they are really helpful. Please create more such practical scenario based video on rest api.

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

      Sure Vaishnavee 🙂🙂👍👍

  • @mysteriouscartoontales
    @mysteriouscartoontales 2 роки тому +5

    Great video. We want more practical part of project.😀

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

    Simply Awesome. Learned a lot. keep producing videos 😎

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

    Simple and easy to understand 👌🏻

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

    wonderfully explanations. hatts of

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

    Nice Explanation mam,if possible plz make video on maintaining versions using swagger also.

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

    Great explanation, really helpful 🙏

  • @sushilpal5593
    @sushilpal5593 2 роки тому +16

    Dear, make some videos on Junit it's very important in terms of interview

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

      True Sushil. We will surely make video on junit part 🙂👍

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

      @@CodeDecode hey eagerly waiting for this...

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

    Cool stuff.. Thanks.. Waiting for the next one. Junit n executor framework

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

    Please cover difference between PUT and PATCH. What is OPTION? Thank You.

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

    Very good tutorial,I'd like to see tutorials with spring framework and with intwrview questions of spring framework too

  • @abc5.-_
    @abc5.-_ Рік тому

    Please make an additional video on advanced Rest API like options, header, patch vs put etc

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

    Thank and very useful content

  • @krp-r4n
    @krp-r4n Рік тому

    thank you so much mam for this video. i faced one question on swagger during the Accenture L1 interview. what is the use of $ in swagger. plz answer...

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

    Please make video on swagger implementation with spring security

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

    Great 👍 please create subsequent videos.

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

      Sure thanks Sourabh 🙂👍

  • @dipaliyadav-koli1060
    @dipaliyadav-koli1060 2 роки тому +1

    🙌 Thank you for sharing ❤️

  • @AshishYadav-se4db
    @AshishYadav-se4db 2 роки тому +1

    Great Explanation mam!

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

    Thanks a million

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

    i can confirm this is what is done in realtime

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

    Dear Miss
    Nice content . Why rushing ?
    Please redo the video by going slowly and clearly .

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

      Thanks Shankar . Sure we will try to reduce pace. Just that we don't want people to waste time before their interviews. We know how much it sucks when content creators just do time pass in videos for money. Rushing means less time, means less money. But if you want, we can take more time.

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

    Hi it was very useful video..@code decode .. do you have git repo for the code you developed.. could you share if you have

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

    Please provide next level of interview questions also.

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

    Please make video on DevOps tools, waiting for that.

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

      sure we will create it in near future

  • @BANDARIMAHESH-c5z
    @BANDARIMAHESH-c5z 3 місяці тому

    I have added the spring fox dependency to my project. But every time I run this project, I get data sources is not defined. If remove the dependency and it's respective class I do not get any error. Strage

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

    Could you also make a video on how to integrate our spring boot application with splunk / dynatrace

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

      Sure Teja 👍is it used in your project?

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

      Yes ..but I am not aware about the integration

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

      True. Lemme check how much feasible and optimum it is for prod ready deployments. 👍🙂

  • @saurabhlothe2245
    @saurabhlothe2245 6 місяців тому

    I have implemented dependency in pom.xml and congifgration file to but I am unable to access swagger UI window in console I am getting no mapping for get /swagger-ui please help me

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

    Can you do a video on spring security .

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

      ua-cam.com/play/PLyHJZXNdCXseGWynh6MlMrC_CmV0dR8mF.html

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

    Also start a series on microservices madam

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

      We already have it
      ua-cam.com/play/PLyHJZXNdCXsd2e3NMW9sZbto8RB5foBtp.html

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

      What else topic you need me to cover Prashanth?

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

      @@CodeDecode Jwt and oAuth please

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

      Sure we will cover it soon

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

    Hi madam can you please create an video how anonymous inner class is used while using lamda expression like when we use lamda what happens internally?

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

    I followed this swagger implementation with Spring version 2.7 and Java 8 and it was not working. It raised an exception at start of application. Is it because of version of Java and old version of spring boot?? Please respond for a clear understanding

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

      Can you please respond with stack trace of error for better understanding the issue

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

    Hi mam, i have only one question,how do you know all these things,i mean how can someone master in all these stuffs

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

      Experience Ankit. With time it automatically comes. It's just we believe in sharing this knowledge so that our IT world can become a better place 👍👍🙂🙂

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

    thanks

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

    make a video on Junit and powermocks mokito

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

    👍

  • @PiyushSingh-rn9zl
    @PiyushSingh-rn9zl Рік тому

    @codeDecode please share your github repo url

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

    pls provide code if possible

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

    The audio and video is too fast

  • @thanipattavan
    @thanipattavan Місяць тому

    Great man thanks for your effort. Your name Y___ Mohan?

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

    I follow the same, But got this exception. Any idea? Tried in stack over flow but not yet find proper reason.
    java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()" because the return value of "org.springframework.web.servlet.mvc.method.RequestMappingInfo.getPatternsCondition()" is null