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

  Рет қаралды 58,385

Code Decode

Code Decode

Күн бұрын

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
@johnnybreathe
@johnnybreathe 2 жыл бұрын
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 жыл бұрын
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 👍👍🙂🙂
@mysteriouscartoontales
@mysteriouscartoontales 2 жыл бұрын
Great video. We want more practical part of project.😀
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Akash 🙂
@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
@kartikRavat-i8y
@kartikRavat-i8y Жыл бұрын
It was very helpful , please add similar content , thank you
@CodeDecode
@CodeDecode Жыл бұрын
Sure Kartik 👍👍
@rakeshkachhadiya
@rakeshkachhadiya Жыл бұрын
Simply Awesome. Learned a lot. keep producing videos 😎
@CodeDecode
@CodeDecode Жыл бұрын
Sure Raakesh👍🙂
@leoking2386
@leoking2386 Жыл бұрын
Please cover difference between PUT and PATCH. What is OPTION? Thank You.
@bathulanagendra4621
@bathulanagendra4621 2 жыл бұрын
Nice Explanation mam,if possible plz make video on maintaining versions using swagger also.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Nagendra 🙂👍
@bhavikjoshi1060
@bhavikjoshi1060 2 жыл бұрын
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
@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
@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 🙂🙂
@krupabhavsar3827
@krupabhavsar3827 Жыл бұрын
wonderfully explanations. hatts of
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Krupa 🙂👍
@sourabhjinde8191
@sourabhjinde8191 2 жыл бұрын
Great 👍 please create subsequent videos.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure thanks Sourabh 🙂👍
@durgabhavani1516
@durgabhavani1516 2 жыл бұрын
Thank you so much mam. Great tutorials. Explained in a great n easy way
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks durga
@043_cse_k.jayalakshmi7
@043_cse_k.jayalakshmi7 7 ай бұрын
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. ✨
@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
@ranjayray2177
@ranjayray2177 Жыл бұрын
Please make video on swagger implementation with spring security
@krishnakshirsagar4570
@krishnakshirsagar4570 2 жыл бұрын
i can confirm this is what is done in realtime
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂
@AshishYadav-se4db
@AshishYadav-se4db 2 жыл бұрын
Great Explanation mam!
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Ashish 🙂👍
@venkatasaikrishnak9385
@venkatasaikrishnak9385 2 жыл бұрын
Please provide next level of interview questions also.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure 🙂👍
@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. 👍🙂
@aniankiraja689
@aniankiraja689 2 жыл бұрын
Please make video on DevOps tools, waiting for that.
@CodeDecode
@CodeDecode 2 жыл бұрын
sure we will create it in near future
@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 👍👍🙂🙂
@rishiraj2548
@rishiraj2548 2 жыл бұрын
Thanks a million
@CodeDecode
@CodeDecode 2 жыл бұрын
You're welcome rishi
@krishnalakshmi8896
@krishnalakshmi8896 2 жыл бұрын
Can you do a video on spring security .
@CodeDecode
@CodeDecode 2 жыл бұрын
kzbin.info/aero/PLyHJZXNdCXseGWynh6MlMrC_CmV0dR8mF
@PiyushSingh-rn9zl
@PiyushSingh-rn9zl Жыл бұрын
@codeDecode please share your github repo url
@amarthyaseshu683
@amarthyaseshu683 2 жыл бұрын
👍
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂🙂
@harshallahamge9743
@harshallahamge9743 2 жыл бұрын
pls provide code if possible
@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...
@novaashokan9953
@novaashokan9953 Жыл бұрын
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
@shankarparavastu8672
@shankarparavastu8672 Жыл бұрын
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.
@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 🙂👍👍🙂
@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
@nishantk6547
@nishantk6547 2 жыл бұрын
Simple and easy to understand 👌🏻
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Nishant 🙂👍
@srinuk2986
@srinuk2986 2 жыл бұрын
Thank you for sharing useful videos, Code Decode is a Next leval.........Thank you
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Srinu 🙂🙂
@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
@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 Жыл бұрын
Great explanation, really helpful 🙏
@CodeDecode
@CodeDecode Жыл бұрын
you're welcome
@krishnakshirsagar4570
@krishnakshirsagar4570 2 жыл бұрын
make a video on Junit and powermocks mokito
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Krishna 🙂👍
@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...
@ChakravarthyTumma
@ChakravarthyTumma 2 жыл бұрын
Thank and very useful content
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks 🙂🙂👍
@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👍
@dipaliyadav-koli1060
@dipaliyadav-koli1060 2 жыл бұрын
🙌 Thank you for sharing ❤️
@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
@malaiarasi4400
@malaiarasi4400 2 жыл бұрын
Cool stuff.. Thanks.. Waiting for the next one. Junit n executor framework
@rajuTravelMemories
@rajuTravelMemories 2 жыл бұрын
The audio and video is too fast
@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
@ma8969
@ma8969 2 жыл бұрын
thanks
@CodeDecode
@CodeDecode 2 жыл бұрын
you're welcome
@thanipattavan
@thanipattavan Ай бұрын
Great man thanks for your effort. Your name Y___ Mohan?
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 69 МЛН
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 89 МЛН
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 12 МЛН
Deep Dive into REST API Design and Implementation Best Practices
12:02
Software Developer Diaries
Рет қаралды 52 М.
REST API Interview Questions (Advanced Level)
6:19
Exponent
Рет қаралды 67 М.
REST API Interview Questions (Beginner Level)
7:07
Exponent
Рет қаралды 182 М.
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 69 МЛН