JSON Beginner Tutorial | How to validate JSON

JSON Beginner Tutorial | How to validate JSON


JSON Beginner Tutorial | How to validate JSON

How to check your JSON is valid
How to find errors | Demo
website - https://automationstepbystep.com/

Join Automation Step By Step channel: https://www.youtube.com/automationste

Udemy Discounts - https://automationstepbystep.com/udem

Every LIKE \u0026 SUBSCRIPTION gives me great motivation to keep working for you

You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can.

_______ ONLINE COURSES TO LEARN _______
https://automationstepbystep.com/onli

GitHub - https://github.com/Raghav-Pal/
Udemy - https://www.udemy.com/user/raghav-pal-3/
Training by Raghav at your venue - [email protected]
Training schedule - https://automationstepbystep.com/trai

----------- UI TESTING -----------
Selenium Beginners - https://bit.ly/2MGRS8K
Selenium Java Framework from Scratch - https://bit.ly/2N9xvR6
Selenium Python - https://bit.ly/2oyMp5x
Selenium Tips - https://bit.ly/2owxc50
Selenium Builder - https://bit.ly/2MKNtlq
Katalon Studio - https://bit.ly/2wARFdi
Robot Framework with RIDE- https://bit.ly/2Px6Ue9
Robot Framework with Eclipse - http://bit.ly/2N8DZxb
Protractor - http://bit.ly/2KtqVkU
TestProject - http://bit.ly/2DRNJYE

----------- API TESTING -----------
Web Services (API) - https://bit.ly/2MGafL7
SoapUI - https://bit.ly/2MGahmd
Postman - https://bit.ly/2wz8LrW
General - https://bit.ly/2PYdwmV
Katalon Studio API Testing - https://bit.ly/2BwuCTN

----------- MOBILE TESTING -----------
Appium - https://bit.ly/2ZHFSGX
Mobile Playlist - https://bit.ly/2PxpeUv

----------- CI | CD | DEVOPS -----------
Jenkins Beginner - https://bit.ly/2MIn8EC
Jenkins Tips \u0026 Trick - https://bit.ly/2LRt6xC
Docker - https://bit.ly/2MInnzx
Kubernetes - http://bit.ly/2MJIlMK

------------VIRTUALISATION------------
Virtualization on windows - http://bit.ly/2SItIL9
----------- VERSION CONTROL SYSTEM -----------
Git \u0026 GitHub - https://bit.ly/2Q1pagY
GitLab - http://bit.ly/2kQPGyQ

----------- PERFORMANCE TESTING -----------
JMeter Beginner - https://bit.ly/2oBbtIU
JMeter Intermediate - https://bit.ly/2oziNVB
JMeter Advanced - https://bit.ly/2Q22Y6a
JMeter Tips \u0026 Tricks - https://bit.ly/2NOfWD2
Performance Testing - https://bit.ly/2wEXbLS

----------- PROGRAMMING -----------
Java Beginners - https://bit.ly/2PVUcXs
Java Tips \u0026 Tricks - https://bit.ly/2CdcDnJ
GROOVY - https://bit.ly/2FvWV5C
JAVASCRIPT - http://bit.ly/2KJDZ8o
PYTHON - http://bit.ly/2Z4iRye

----------- IDE -----------
Visual Studio Code - https://bit.ly/2V15yvt

----------- BUILD TOOLS -----------
Maven - https://bit.ly/2NJdDRS
Gradle - http://bit.ly/30l3h1B

----------- OTHERS -----------
Redis- https://bit.ly/2N9jyCG
Misc - https://bit.ly/2Q2q5xQ
Tools \u0026 Tips - https://bit.ly/2oBfwoR
QnA Friday- https://bit.ly/2NgwGpw
Sunday Special - https://bit.ly/2wB23BO

Ask Raghav - https://bit.ly/2CoJGWf
Interviews - https://bit.ly/2NIPPxk
All Playlists - https://bit.ly/2LSiezA

---------- Connect with Raghav -----------
Website - https://automationstepbystep.com/
LifeCharger - http://lifecharger.org/
Udemy Courses - https://www.udemy.com/user/raghav-pal-3/
Facebook - https://www.facebook.com/automationst
Twitter - https://twitter.com/LearnWithRaghav
Youtube -    / automationstepbystep  

Never Stop Learning
Raghav


Content

1.339 -> Hello and welcome to this session I am Raghav And in this session, We are going to go very
7.21 -> basic step by step and we will learn how we can check that our JSON is valid or how we
13.41 -> can find any errors in the syntax or any issues with our JSON message or the JSON file We
20.27 -> will see a very quick demo on how you can use different tools online and find issues
25.869 -> with your Json message or your JSON file. in the last Session, we had created this file
32.48 -> demo dot Json and here you can see this is the data in this file So we created these
39.34 -> arrays and objects So we have a user's array which has all these objects, and then we had
45.07 -> subjects array and then we have all these data added.
48.8 -> So just in case, you have not watched the last session you can go and see that if you
54.17 -> do not have your Json ready or if you have any JSON file or any Json message you can
59.52 -> Let us say I want to just check that This Json is correct And there are no issues So
66.939 -> for that I will go to Google and search for how to validate JSON and here you can see
74.31 -> I have got a lot of online tools available.
76.82 -> There is Json lint Let me go here and I will also check for this Json validator and free
86.509 -> for matter and let me check this one as well And then this we have from code beautify This
93.149 -> will help us to beautify our Json So these tools will also help you to beautify your
98.729 -> Json or correct the formatting So now let me show you one by one I will copy the entire
105.859 -> thing from here and I will go to this first tool which is JSON lint now in the description
112.569 -> or the notes of this video I will also provide all these links show so you can always check
118.069 -> the notes and get all these links from Here I am pasting my entire Json here And then
125.029 -> I will click on this button validate Json and here you can see there is some issue So
131.849 -> here it says there is some error on line 22 there is a parsing error So if I go to line
138.319 -> number 22, and yes, you can see this is the subjects array and here if you see after this
144.599 -> first object I did not give a comma and that is why there is this issue So I should give
150.22 -> a comma here and I will again say validate Json and now it is saying this is a valid
155.209 -> Json So this is the first thing let us see some more tools and you can then compare which
160.7 -> is better I will go to this Json schema validator And again, I will copy my Json and paste it
168.9 -> here and then you can see So this is for schema They should be a schema here Now I will tell
178.049 -> you about schema later So this we do not need as of now because we do not have a Json schema
182.939 -> We directly have a Json message And yes, this is the Json validator I will again copy my
189.68 -> Json and say validate Json here and let us see the output So in this case again, we are
198.73 -> getting the issue So it says the Json input is not valid in JavaScript missing a ] after
207.17 -> the list at line 29 So it says at line number 29, we have some issue but this is not very
216.65 -> good and it is does not give us direct information and does not also gives us the direct position
224.92 -> like we could get here So this is not very good or if I compare with the earlier one.
231.159 -> This is not very intuitive for me Let me go to the JSON formatter and validator I will
238.06 -> again paste my Json message and click on the process and let us see the output here and
245.349 -> here you can see this is much better.
247.569 -> It is saying that expecting comma or a closing square bracket and not this at this particular
255.799 -> line So now here if I click on this you can also see it is highlighting this so did you
262.23 -> see it highlighted this so when I click here It is highlighting this here It is highlighting
268.729 -> this here This is very intuitive It is actually giving us the exact issue It is also showing
275.88 -> us what is expected and is also highlighting exactly at what position we need to put this
283.11 -> comma or a ] so here this is much better and if I just go and give a comma here and now
293.46 -> I will say process and this time you can see this is a this is- this is a valid Json So
299.979 -> this is much better then if I go to this Json validator and again, I will paste my Json
306.72 -> and I will say validate Json and here again, you can see it is giving us this issue which
311.389 -> is a parse error and also it is giving us what is expected And also giving us the position
317.15 -> So this is also better until now I have found this Json format and validator the best until
323.94 -> now you can also beautify your Json So if you search for Json for matter or Json beautifier,
331.55 -> let me search for Json beautifier So just in case you create your Json without giving
340.43 -> all these spaces tabs and everything You can always just copy your Json and go to some
346.479 -> Json format or beautify like this so you can see there are so many tools online and you
354.039 -> just have to provide your Json message here or Json text here So here I can give it like
363.08 -> this And here I can see beautify Json so there is a parse error which we know that they should
372.6 -> be a comma here and now I will say beautify Json and it shows us the this version and
380.19 -> if I go here again, I will add my Json and say beautify again It is showing us this parsing
388.09 -> error I will give a comma here and see beautify and you can see this is here and I can also
394.19 -> see a tree view here which will show us The collapsed form and then you can expand it
400.56 -> like this.
401.56 -> So all the objects and arrays you will see they are now shown in a beautiful tree view
407.69 -> and this can be very handy And this is how you can validate your JSON and you can also
413.48 -> check there if there are any issues and you can beautify your JSON in the next session
417.74 -> We will learn how you can work with Json paths and how you can create a JSON path I hope
424.06 -> this was very useful for you I will meet you in the next session Thank you for watching.

Source: https://www.youtube.com/watch?v=wdVqEHB9zXA