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

  Рет қаралды 55,080

Code Decode

Code Decode

2 жыл бұрын

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/udemycourse
Course Description Video :
yt.openinapp.co/dmjvd
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 : kzbin.info?...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#restapi #codedecode #swaggerrestapi

Пікірлер: 93
@043_cse_k.jayalakshmi7
@043_cse_k.jayalakshmi7 4 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
Nice explanation with short n sweet code...all swagger become easy within 5 min .....great video
@CodeDecode
@CodeDecode Жыл бұрын
Glad to hear that Ravi 🙂👍👍🙂
@malaiarasi4400
@malaiarasi4400 2 жыл бұрын
Cool stuff.. Thanks.. Waiting for the next one. Junit n executor framework
@srinuk2986
@srinuk2986 Жыл бұрын
Thank you for sharing useful videos, Code Decode is a Next leval.........Thank you
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Srinu 🙂🙂
@nishantk6547
@nishantk6547 2 жыл бұрын
Simple and easy to understand 👌🏻
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Nishant 🙂👍
@swapnilmishra697
@swapnilmishra697 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
@rakeshkachhadiya
@rakeshkachhadiya Жыл бұрын
Simply Awesome. Learned a lot. keep producing videos 😎
@CodeDecode
@CodeDecode Жыл бұрын
Sure Raakesh👍🙂
@durgabhavani1516
@durgabhavani1516 2 жыл бұрын
Thank you so much mam. Great tutorials. Explained in a great n easy way
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks durga
@sushilpal5593
@sushilpal5593 2 жыл бұрын
Dear, make some videos on Junit it's very important in terms of interview
@CodeDecode
@CodeDecode 2 жыл бұрын
True Sushil. We will surely make video on junit part 🙂👍
@RishavKumar28
@RishavKumar28 2 жыл бұрын
@@CodeDecode hey eagerly waiting for this...
@mysteriouscartoontales
@mysteriouscartoontales 2 жыл бұрын
Great video. We want more practical part of project.😀
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Akash 🙂
@user-hy5ee8dh7z
@user-hy5ee8dh7z Жыл бұрын
It was very helpful , please add similar content , thank you
@CodeDecode
@CodeDecode Жыл бұрын
Sure Kartik 👍👍
@abc5.-_
@abc5.-_ Жыл бұрын
Please make an additional video on advanced Rest API like options, header, patch vs put etc
@saichakra3888
@saichakra3888 Жыл бұрын
Really great explanation very straight forward points in your Video Thank you 🙂👌
@CodeDecode
@CodeDecode Жыл бұрын
Thanks a lot Sai 🙂🙂
@bhavikjoshi1060
@bhavikjoshi1060 Жыл бұрын
Thank you for all hard work you do!! Please create some videos on mockito and testing.. thanks
@CodeDecode
@CodeDecode Жыл бұрын
sure bhavik we will create it soon
@violetavss1719
@violetavss1719 2 жыл бұрын
Very good tutorial,I'd like to see tutorials with spring framework and with intwrview questions of spring framework too
@CodeDecode
@CodeDecode 2 жыл бұрын
👍👍sure
@leoking2386
@leoking2386 Жыл бұрын
Please cover difference between PUT and PATCH. What is OPTION? Thank You.
@dipaliyadav-koli1060
@dipaliyadav-koli1060 Жыл бұрын
🙌 Thank you for sharing ❤️
@CodeDecode
@CodeDecode Жыл бұрын
🙂🙂
@vaishnaveetopale6403
@vaishnaveetopale6403 Жыл бұрын
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 🙂🙂👍👍
@ajaytumma6985
@ajaytumma6985 11 ай бұрын
Great explanation, really helpful 🙏
@CodeDecode
@CodeDecode 11 ай бұрын
you're welcome
@krupabhavsar3827
@krupabhavsar3827 Жыл бұрын
wonderfully explanations. hatts of
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Krupa 🙂👍
@AshishYadav-se4db
@AshishYadav-se4db 2 жыл бұрын
Great Explanation mam!
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Ashish 🙂👍
@ChakravarthyTumma
@ChakravarthyTumma 2 жыл бұрын
Thank and very useful content
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks 🙂🙂👍
@sourabhjinde8191
@sourabhjinde8191 2 жыл бұрын
Great 👍 please create subsequent videos.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure thanks Sourabh 🙂👍
@bathulanagendra4621
@bathulanagendra4621 2 жыл бұрын
Nice Explanation mam,if possible plz make video on maintaining versions using swagger also.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Nagendra 🙂👍
@rishiraj2548
@rishiraj2548 Жыл бұрын
Thanks a million
@CodeDecode
@CodeDecode Жыл бұрын
You're welcome rishi
@ranjayray2177
@ranjayray2177 Жыл бұрын
Please make video on swagger implementation with spring security
@user-fs5vx5mr5e
@user-fs5vx5mr5e 11 ай бұрын
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...
@krishnakshirsagar4570
@krishnakshirsagar4570 2 жыл бұрын
i can confirm this is what is done in realtime
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂
@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
@amarthyaseshu683
@amarthyaseshu683 2 жыл бұрын
👍
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂🙂
@BANDARIMAHESH-c5z
@BANDARIMAHESH-c5z 2 күн бұрын
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
@krishnakishore1532
@krishnakishore1532 Жыл бұрын
How about the behaviour of swagger incase if we use oauth2. Hope it works for oauth2 as well.
@ma8969
@ma8969 Жыл бұрын
thanks
@CodeDecode
@CodeDecode Жыл бұрын
you're welcome
@venkatasaikrishnak9385
@venkatasaikrishnak9385 2 жыл бұрын
Please provide next level of interview questions also.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure 🙂👍
@saurabhlothe2245
@saurabhlothe2245 3 ай бұрын
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
@aniankiraja689
@aniankiraja689 Жыл бұрын
Please make video on DevOps tools, waiting for that.
@CodeDecode
@CodeDecode Жыл бұрын
sure we will create it in near future
@krishnalakshmi8896
@krishnalakshmi8896 2 жыл бұрын
Can you do a video on spring security .
@CodeDecode
@CodeDecode 2 жыл бұрын
kzbin.info/aero/PLyHJZXNdCXseGWynh6MlMrC_CmV0dR8mF
@tejachowdary309
@tejachowdary309 2 жыл бұрын
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 жыл бұрын
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. 👍🙂
@krishnakshirsagar4570
@krishnakshirsagar4570 2 жыл бұрын
make a video on Junit and powermocks mokito
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Krishna 🙂👍
@challaprashanthreddy9799
@challaprashanthreddy9799 2 жыл бұрын
Also start a series on microservices madam
@CodeDecode
@CodeDecode 2 жыл бұрын
We already have it kzbin.info/aero/PLyHJZXNdCXsd2e3NMW9sZbto8RB5foBtp
@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 жыл бұрын
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?
@CodeDecode
@CodeDecode 2 жыл бұрын
Ok so you need internal working of lambda expression?
@challaprashanthreddy9799
@challaprashanthreddy9799 2 жыл бұрын
@@CodeDecode yes
@CodeDecode
@CodeDecode 2 жыл бұрын
Ok👍
@novaashokan9953
@novaashokan9953 9 ай бұрын
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 9 ай бұрын
Can you please respond with stack trace of error for better understanding the issue
@shankarparavastu8672
@shankarparavastu8672 10 ай бұрын
Dear Miss Nice content . Why rushing ? Please redo the video by going slowly and clearly .
@CodeDecode
@CodeDecode 10 ай бұрын
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.
@PiyushSingh-rn9zl
@PiyushSingh-rn9zl 9 ай бұрын
@codeDecode please share your github repo url
@ankitkumarjain1797
@ankitkumarjain1797 Жыл бұрын
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 Жыл бұрын
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 👍👍🙂🙂
@harshallahamge9743
@harshallahamge9743 2 жыл бұрын
pls provide code if possible
@rajuTravelMemories
@rajuTravelMemories Жыл бұрын
The audio and video is too fast
@BaluKompalli
@BaluKompalli Жыл бұрын
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
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 2,1 МЛН
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 59 МЛН
REST API Interview Questions (Advanced Level)
6:19
Exponent
Рет қаралды 58 М.
How to add Swagger to Spring Boot - Brain Bytes
21:09
Java Brains
Рет қаралды 447 М.
REST API Interview Questions (Beginner Level)
7:07
Exponent
Рет қаралды 158 М.
From 0 to Back-End Developer in 12 Months: The Complete Roadmap
8:24
Programming with Mosh
Рет қаралды 107 М.
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН