JSON Schema Validation: How to Validate JSON Schema with Postman?

  Рет қаралды 102,550

The Testing Academy

The Testing Academy

Күн бұрын

#API #APITesting #Postman #APITestingTutorials.
Buy the Full course Here - ►► www.udemy.com/course/learning... ◄◄
What is JSON ?
What is JSON Schema ?
Why JSON Schema Validation required?
Basic JSON Schema example
How to do JSON Schema Validation in Postman Step by step
Tiny Validator for JSON Schema v4
What is JSON?
JSON stands for JavaScript Object Notation
JSON is a lightweight format for storing and transporting data
JSON is often used when data is sent from a server to a web page
JSON is "self-describing" and easy to understand
What JSON Schema
JSON Schema is a contract for your JSON document that defines the expected data types and format of each field in the response
Why JSON Schema Validation required?
Using JSON Schema to construct a model of your API response makes it easier to validate your API is returning the data is should.
Monitor your API responses, ensuring they adhere to a specified format.
Get alerted when breaking changes occur.
How to do JSON Schema Validation in Postman Step by Step?
Generate JSON Schema
jsonschema.net/#/
Object Assertions and check REQD Properties. We do this so that every element in the JSON becomes mandatory.
Number Assertions and check Use number, not integer for all numeric instances
Configure and Test using Postman
Tiny Validator for JSON Schema v4
Use json-schema draft v4 to validate simple values and complex objects using a rich validation vocabulary
github.com/geraintluff/tv4
Notes about JSON Schema Validation - dynalist.io/d/eDFZUS1L8emTU5B...
JSON Schema Documentation - json-schema.org/
API Used - reqres.in/api/users/2
JSON Schema Creator Tool - jsonschema.net/
More About Tiny Validator - geraintluff.github.io/tv4/
Join Facebook Group : bit.ly/learntesting2019
Website: scrolltest.com
Website: thetestingacademy.com
Twitter: / itstechmode
Full Postman Code - pastebin.com/C68BfMxi
🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌
✅Selenium Training and Certification -
scrolltest.com/go/edureka
✅Learn Jenkins for QA -
bit.ly/learnjenkins-p1
✅Programming Java -
bit.ly/learnjava2020-p1
✅Test Automation -
bit.ly/learnautomation2020
✅API Testing -
www.learnapitesting.com
✅Cypress Tutorial with LIVE Projects -
cypresstutorial.com

Пікірлер: 90
@jakekuykendall2648
@jakekuykendall2648 2 жыл бұрын
thanks! your video pointed me to where my json schema was messed up. dumb mistake on my part just needed to walk through it and your video highlighted right where my mistake was.
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
Thanks for the awesome feedback
@constantinyakun3777
@constantinyakun3777 2 жыл бұрын
Great Simple explanation json schema validation
@rashmiambedkar5143
@rashmiambedkar5143 4 жыл бұрын
Thanks for insightful video session. Kudos.
@vinayrathod9972
@vinayrathod9972 5 жыл бұрын
Really awesome video. Thanks dude for sharing this info :)
@kirangaikwad4109
@kirangaikwad4109 3 жыл бұрын
Awesome information but more focus on zooming part in next video thanks :) Also it will be great if you show same validation in rest assured in another video.
@naveen051987
@naveen051987 Жыл бұрын
do we always need to hit our service via postman to validate it against json schema? for that our service should be working end to end always. or we can just use json request response and can validate it against json schema with out hitting our service?
@satinderpal9393
@satinderpal9393 2 жыл бұрын
Hi, the schema of my response body is dynamic i.e... Sometimes response body is {"address": xyz street, "zip code": 12345, "city": ABCD}. Sometimes it's {"address": xyz street, "zip code": 12345}. How can i code"required" in the Tests in such a scenario. Thanks
@sarscov9854
@sarscov9854 2 жыл бұрын
How do you validate the actual schema though? Like lets say the developer set a field as number when it should be string and no one caught it. How can QA catch it?
@svetlanamazhaykina6918
@svetlanamazhaykina6918 4 ай бұрын
Thanks for your work! Well done!
@india23061974
@india23061974 2 жыл бұрын
Кто от Ксендзова? Привеет)) Автору мерси за видео, частично помогло
@michaeljoshua630
@michaeljoshua630 4 жыл бұрын
Thank you brother
@Aryan_Boy_Programmer
@Aryan_Boy_Programmer 5 ай бұрын
I liked the Video and Thanks for making this it helps me a lot!!
@Aryan_Boy_Programmer
@Aryan_Boy_Programmer 5 ай бұрын
but please give in updated version!
@ZeryuGames
@ZeryuGames 3 жыл бұрын
Thanks for this. You are so kind sharing this content!
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Glad you enjoyed it!
@rajashreekale3894
@rajashreekale3894 2 жыл бұрын
Schema is hardcoded in test script. Can we save the schema in external Json file and read that file in test scripts?
@jasminlaroche2145
@jasminlaroche2145 3 жыл бұрын
There is error in my generated JSON schema that I generated from the tool. Could you please help me out ? Many thanks!
@technicalmaster623
@technicalmaster623 Жыл бұрын
There was an error in evaluating the test script: SyntaxError: Unexpected token ':' schma valiation in postman
@lemidori8487
@lemidori8487 4 жыл бұрын
it is useful to me. Thanks lots
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Glad you liked it, Do Share with your Friends
@sumithawreddy5838
@sumithawreddy5838 3 жыл бұрын
Hi I have one sample json file which is around 400 line using java program developed avro schema and registered it in our company source it generated endpoint url..using that validatig in postman with the sample json data file I am getting following error can any one please help me out this is the first time I am working on this schema.. I need help ASAP "error_code": 42203, "message": "Conversion of JSON to Avro failed: Failed to convert JSON to Avro: Expected field name not found: CostCentreReplicationBulkRequest" }
@priyadgp
@priyadgp 3 жыл бұрын
Hi, please let me know if we can form the json path by referring values in data file .. for example: var jsonData = pm.response.json(); pm.test("Enterprise of servers is an object", () => { pm.expect(jsonData.Result.enterprises.siebel).to.be.an("object"); }); Here i want the value siebel to come from datafile in json format (added to collection runner)
@rajashreekale3894
@rajashreekale3894 2 жыл бұрын
I have similar query. Did you get any solution?
@MadirajuKChaitanya
@MadirajuKChaitanya 3 жыл бұрын
Nice Video. Thanks for sharing.
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Thanks for the awesome feedback ❤️ it
@user-li9pj9th8i
@user-li9pj9th8i Жыл бұрын
Thanks for easy explanation, it really helped. I tired and getting error {} ,
@Crick_funnyshorts
@Crick_funnyshorts 4 жыл бұрын
Hi i have a issue, not able to validate with hyphen eg - "maxmemory-reserved": "200", i m etting error as reserved not defined
@Crick_funnyshorts
@Crick_funnyshorts 4 жыл бұрын
pm.expect(jsonData.value[indexProject].properties.redisConfiguration.maxmemory-reserved).equal(pm.environment.get("xxxx"));
@SocialMedia-io1tz
@SocialMedia-io1tz 4 жыл бұрын
Hi, i want to validate json via logic apps what schema to pass, lets say i dont want to accept any schema that miss one of the field like name, How to achieve this
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
You can use the required in the schema
@michaeldefrank8413
@michaeldefrank8413 5 жыл бұрын
I'm unable to cause my test to fail. I've tried changing the property name in the schema and also purposely changing the call so that it will not return 200. In both cases, the test still passes. Any suggestions?
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Can you contact me on Facebook, I will help m.me/scrolltest
@rashmiambedkar5143
@rashmiambedkar5143 4 жыл бұрын
It's really helpful. Can u a video when collection is checkout from git . Basically how to use git repo with postman collection
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thats an amazing idea, will try to do it.
@mzamomahaeng268
@mzamomahaeng268 Жыл бұрын
Thank you for this
@TheTestingAcademy
@TheTestingAcademy Жыл бұрын
My pleasure!
@PraveenKumar-rj8uy
@PraveenKumar-rj8uy 4 жыл бұрын
Is there any way to see what caused the failure . Like for example , in failure I want a message to be displayed that the failure is due to 'id' expected string , actual data type is number
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
As far i remember library in postman like tv4 validator gives you these kind of errors, or you can write some custom message after assertion that will also serve the purpose
@shahzeb3445
@shahzeb3445 3 жыл бұрын
very usefull video !
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Thanks a lot for the feedback, shot us email at contact@thetestingacademy.com
@yaminigrandhi2776
@yaminigrandhi2776 3 жыл бұрын
How to validate no of website links sending as a file in json schema and validate??
@rohitsethi2085
@rohitsethi2085 3 жыл бұрын
Hi, I have 790 lines of JSON Schema and I am getting an error in the POSTMAN console as "Invalid Schema: Invalid type: null (expected string)" It is very difficult to find out for which line the error is coming, so Is there any way to get it?
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
There are two json schema validators ajv and tiny validators, try ajv
@rohitsethi2085
@rohitsethi2085 3 жыл бұрын
@@TheTestingAcademy Thanks Its is working but still, it is not showing the line number.
@marketguru4197
@marketguru4197 4 жыл бұрын
can you teach request chaning in api .
@haciarpaci4227
@haciarpaci4227 2 жыл бұрын
great!
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
Glad you liked it and please share it with your friends.
@saivamshikrishnapeddammala8678
@saivamshikrishnapeddammala8678 2 жыл бұрын
Hi , How to send Json data for post request with Invalid Escape character (\) in string like Ptl ao.s in postaman
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
Will upload soon
@s1h2r345
@s1h2r345 2 жыл бұрын
How to validate request/response schema validation based on Swagger/Open API
@ankitnegi163
@ankitnegi163 2 жыл бұрын
Sir how can we get the body from the payload please explain that in one video.
@vipulranjankhare6570
@vipulranjankhare6570 4 жыл бұрын
I am able to implement what you have explained in the video............but this logic is not checking for case sensitivity......for eg in the schema if I am defining a field in camel casing but the response which is coming there the field is in lower caps then it should error out.........but it is not erroring out.......can you please help me here in implementing case sensitivity?
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Email me at contact@thetestingacademy.com
@vipulranjankhare6570
@vipulranjankhare6570 4 жыл бұрын
The Testing Academy I have already emailed yesterday......please take a look
@vipulranjankhare6570
@vipulranjankhare6570 4 жыл бұрын
@@TheTestingAcademy I have dropped 2 mails to you and also listed out the issue here but still no reply from your end.........please take a look
@sanjivlalit8869
@sanjivlalit8869 4 жыл бұрын
Content is good, it can be better if the font is large, specially the scripting area, it's hardly readable.
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Releasing a new amd more advance video on jaon schema, thanks for the awesome feedback
@Manoj-gr7kn
@Manoj-gr7kn 8 ай бұрын
How will we know at what line it is failing ?
@meghasandesam
@meghasandesam 4 жыл бұрын
Nice tutorial...please make font size big..
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thanks for the awesome feedback ❤️
@rajeshraju2674
@rajeshraju2674 4 жыл бұрын
It'd be good if you "Zoomin" on important areas , the screen is too tiny even for my laptop.
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Try HD mode
@snehapatil5473
@snehapatil5473 3 жыл бұрын
Can you provide the test script which you written
@venkateshkumar1840
@venkateshkumar1840 4 жыл бұрын
Json schema validation UI option selection got changed ,I am trying my end Tiny validation
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Its Same var schema = { "items": { "type": "boolean" } }; var data1 = [true, false]; var data2 = [true, 123]; pm.test('Schema is valid', function() { pm.expect(tv4.validate(data1, schema)).to.be.true; pm.expect(tv4.validate(data2, schema)).to.be.true; });
@haneeshant2451
@haneeshant2451 2 жыл бұрын
How can I do schema validation when response body is dynamic? Please help
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
You need to check what all fields are dynamic, soke structure will be statix which you xan Validate
@mangeshpardeshi9510
@mangeshpardeshi9510 3 жыл бұрын
Must Elaborate more regarding schema
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Check more video for advance stuff
@ajaykawde1735
@ajaykawde1735 2 жыл бұрын
I want to automate this process in java, can anyone suggest?
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
Same process, just find the correct Libraries
@lizalinnayak1029
@lizalinnayak1029 4 жыл бұрын
Hi, My test is getting failed, Could you please help me out..
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Mail me at contact@thetestingacademy.com
@vijaykumar-ut1ze
@vijaykumar-ut1ze 4 жыл бұрын
Can you make video for schema validations for input request
@eco89
@eco89 3 жыл бұрын
Use same concept in pre-request and then if validation is pass then save it to env variable and import to postman Body.
@freelanceritsolutions6607
@freelanceritsolutions6607 Жыл бұрын
720 p par bhi videos mein clarity nahi hai....
@SunilKumar-hl8oh
@SunilKumar-hl8oh 5 жыл бұрын
Font is very small ,unable to follow
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Use HD feature
@yusufolaide2718
@yusufolaide2718 4 жыл бұрын
My test is failing
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Send me the code at contact@thetestingacademy.com
@aigulidrisova1126
@aigulidrisova1126 Жыл бұрын
👍🦸
Conditional WorkFlow in Postman : API Testing using Postman
4:23
The Testing Academy
Рет қаралды 22 М.
REST Assured Beginner Tutorial 10 | How to validate JSON Schema
13:11
Automation Step by Step
Рет қаралды 57 М.
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 5 МЛН
JSON Schema validation in Postman
9:29
Valentin Despa
Рет қаралды 47 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,1 МЛН
JSON Schema explained and validated in IntelliJ
21:27
Mike Møller Nielsen
Рет қаралды 18 М.
Part 9: How to put Assertions/Validations in your API tests
26:08
Automation Testing Insider
Рет қаралды 2,6 М.
JSON Schema Validation in Python: Bring Structure Into JSON
13:45
Postman Tutorial #44 - Validate JSON Response Values and Datatypes
13:51
Software Testing Mentor
Рет қаралды 12 М.
王子居然在家这样 #艾莎
0:38
落魄的王子
Рет қаралды 27 МЛН
Быстрые листья для голубцов
0:36
Мистер Лайфхакер
Рет қаралды 9 МЛН
МТЗ-80, подписывайтесь на канал, есть видео.
0:56
Александр Маляр
Рет қаралды 6 МЛН
Bizda +50☀️ Subscribe❤️
0:14
Hayot Sinovlari
Рет қаралды 4,9 МЛН