What is JSON Schema

  Рет қаралды 96,252

Automation Step by Step

Automation Step by Step

Күн бұрын

website - automationstep...
What is JSON Schema
How to create JSON Schema from JSON
Demo
To validate JSON for:
Formatting
Syntax
Data types
Structure & Content
JSON Schema is written in JSON
“JSON Schema is JSON Document that describes other JSON Documents”
defines the structure of a JSON message
Can use to validate a JSON message
OR
API request and response in JSON format
Join Automation Step By Step channel: www.youtube.co...
Udemy Discounts - automationstep...
Every LIKE & 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 _______
automationstep...
GitHub - github.com/Rag...
Udemy - www.udemy.com/...
Training by Raghav at your venue - raghav.qna@gmail.com
Training schedule - automationstep...
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework with RIDE- bit.ly/2Px6Ue9
Robot Framework with Eclipse - bit.ly/2N8DZxb
Protractor - bit.ly/2KtqVkU
TestProject - bit.ly/2DRNJYE
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
Katalon Studio API Testing - bit.ly/2BwuCTN
----------- MOBILE TESTING -----------
Appium - bit.ly/2ZHFSGX
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
Kubernetes - bit.ly/2MJIlMK
------------VIRTUALISATION------------
Virtualization on windows - bit.ly/2SItIL9
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
GitLab - bit.ly/2kQPGyQ
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- PROGRAMMING -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
GROOVY - bit.ly/2FvWV5C
JAVASCRIPT - bit.ly/2KJDZ8o
PYTHON - bit.ly/2Z4iRye
----------- IDE -----------
Visual Studio Code - bit.ly/2V15yvt
----------- BUILD TOOLS -----------
Maven - bit.ly/2NJdDRS
Gradle - bit.ly/30l3h1B
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
---------- Connect with Raghav -----------
Website - automationstep...
LifeCharger - lifecharger.org/
Udemy Courses - www.udemy.com/...
Facebook - / automationstepbystep
Twitter - / learnwithraghav
KZbin - / automationstepbystep
Never Stop Learning
Raghav

Пікірлер: 112
@kal1nas
@kal1nas 2 жыл бұрын
You speak clearly, you don’t rush, you record in 1080p60fps, you give examples, you draw graphs - THANK YOU. I will support your channel!
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks a lot
@emmanuelmotsi
@emmanuelmotsi 2 жыл бұрын
definitely agree. Thank you, great explanation!
@cutiepiec2829
@cutiepiec2829 3 жыл бұрын
I encountered json schema during one of the test.. now I clearly understood.. Thank you 😊😊😊
@RaghavPal
@RaghavPal 3 жыл бұрын
Glad it helped!
@benheideveld4617
@benheideveld4617 3 жыл бұрын
You are: a great teacher!
@RaghavPal
@RaghavPal 3 жыл бұрын
Humbled to see your message Ben, I am learning & improving daily
@redyeti7371
@redyeti7371 7 ай бұрын
This was AMAZING. Exceptional teaching skill, I got the concept perfectly, thank you!!
@RaghavPal
@RaghavPal 7 ай бұрын
Most welcome Chad
@venkatanarasimha8489
@venkatanarasimha8489 9 ай бұрын
good
@RaghavPal
@RaghavPal 9 ай бұрын
Thanks Venkata
@markthomas9641
@markthomas9641 2 жыл бұрын
Great video, thank you. DeltaJSON is really useful if you are working with JSON, it does compare, merge and graft.
@RaghavPal
@RaghavPal 2 жыл бұрын
Great to hear!
@tanmayshukla6444
@tanmayshukla6444 3 жыл бұрын
You're good at this! Keep it up. Subtle and crisp.
@RaghavPal
@RaghavPal 3 жыл бұрын
I appreciate that Tanmay
@abhijeets6593
@abhijeets6593 3 жыл бұрын
Love it !!
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks for watching Abhijeet
@nghiavoai7993
@nghiavoai7993 3 жыл бұрын
Very useful course. Thank you for sharing!
@RaghavPal
@RaghavPal 3 жыл бұрын
Most welcome Nghĩa
@pankajnirabh5909
@pankajnirabh5909 3 жыл бұрын
clear explanation, thanks Raghav
@RaghavPal
@RaghavPal 3 жыл бұрын
You're most welcome Pankaj
@nikhil978k
@nikhil978k Жыл бұрын
Sir your really a god gifted teacher.
@RaghavPal
@RaghavPal Жыл бұрын
Thanks for the kind words Nikhil
@roushansingh8895
@roushansingh8895 2 жыл бұрын
Focusing on word a great Idea. Keep it up 🙏🙏
@RaghavPal
@RaghavPal 2 жыл бұрын
Thank you
@nidhi26100
@nidhi26100 3 жыл бұрын
Thankyou for this video!!
@RaghavPal
@RaghavPal 3 жыл бұрын
You're so welcome Nidhi
@saranyajothi9691
@saranyajothi9691 2 жыл бұрын
No words to say... really really good
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks a lot Saranya
@lkarthik1985
@lkarthik1985 3 жыл бұрын
As usual excellent content. Thanks 🙏
@RaghavPal
@RaghavPal 3 жыл бұрын
Glad you enjoyed it
@amitchauhan1505
@amitchauhan1505 3 жыл бұрын
How to create schema for json where Array members are unknown, like users array size can b2 2 or 4 or 6 some day. I see in this example that schema is only created as per given JSON.
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Amit, you can use wild characters and dynamic properties, Check stackoverflow.com/questions/28697209/json-schema-for-dynamic-properties
@bindunagaraj123
@bindunagaraj123 3 жыл бұрын
wow, such a simple explanation.
@RaghavPal
@RaghavPal 3 жыл бұрын
Glad it was helpful Bindu
@isra2163
@isra2163 Жыл бұрын
Thank u for your explain✨
@RaghavPal
@RaghavPal Жыл бұрын
You’re welcome 😊
@sagarbhave5483
@sagarbhave5483 3 жыл бұрын
Thank you Raghav for Raghav for the wonderful explanation I have one question what is application of xml in embedded systems
@RaghavPal
@RaghavPal 3 жыл бұрын
XML is basically for data & information exchange and can be used to transfer data between 2 systems or apps
@svalyavasvalyava9867
@svalyavasvalyava9867 Жыл бұрын
thank you, amazing explanation!!!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome
@Arwen6arwen
@Arwen6arwen 3 жыл бұрын
It was extremely useful! Thank you!
@RaghavPal
@RaghavPal 3 жыл бұрын
Glad it was helpful Arwen
@RushalPatil825
@RushalPatil825 2 жыл бұрын
Well explained. Thanks for the video
@RaghavPal
@RaghavPal 2 жыл бұрын
Glad it was helpful Rushal
@user-cp6cq8cx6m
@user-cp6cq8cx6m 2 жыл бұрын
helped a lot in my work 🙏thank you very much ♥
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome
@nitinkumarchauhan688
@nitinkumarchauhan688 2 жыл бұрын
So simple and amazing thanks for sharing
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome
@gauravdalvi9288
@gauravdalvi9288 3 жыл бұрын
Great job it's really helpful
@RaghavPal
@RaghavPal 3 жыл бұрын
Glad it helped
@roymoran1151
@roymoran1151 3 жыл бұрын
very nice. very nice.
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks a lot Roy
@mahadev1050
@mahadev1050 3 жыл бұрын
Awesome👏👏👏👏
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks
@BG-fo4si
@BG-fo4si 2 жыл бұрын
Great job
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks
@vishaltripathi8608
@vishaltripathi8608 3 жыл бұрын
making video for json parsing library . very effective video for automation testing
@vishaltripathi8608
@vishaltripathi8608 3 жыл бұрын
TestNG
@RaghavPal
@RaghavPal 3 жыл бұрын
glad to know it is helping Vishal
@subhamthemusicalguy8851
@subhamthemusicalguy8851 2 жыл бұрын
Thanks a lot
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome Subham
@aljon7992
@aljon7992 3 жыл бұрын
Thanks teacher
@RaghavPal
@RaghavPal 3 жыл бұрын
You are welcome
@VishalSharma-rn7mt
@VishalSharma-rn7mt 3 жыл бұрын
great video
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks Vishal
@kirubababu9255
@kirubababu9255 Жыл бұрын
How to create ourself json to json schema in python and validate with json response? Do we have any code?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Kiruba, Yes, you can create a JSON schema and validate JSON responses in Python using the jsonschema library. Can check here - pynative.com/python-json-validation/
@kirubababu9255
@kirubababu9255 Жыл бұрын
@@RaghavPal Thanks for your soln!! Is there any way to convert json response to json schema?
@RaghavPal
@RaghavPal Жыл бұрын
To convert a JSON response to a JSON Schema in Python, you can use the jsonschema library. Here is an example of how to do it: import jsonschema # Your JSON response response = { "name": "John Doe", "age": 30, "email": "johndoe@example.com" } # Generate the JSON Schema schema = jsonschema.Draft7Validator.check_schema(response) # Print the schema print(schema)
@kirubababu9255
@kirubababu9255 Жыл бұрын
@@RaghavPal Thanks!! The same code which I got from ChatGPT, but it's not working as expected
@RaghavPal
@RaghavPal Жыл бұрын
will need to try with some online examples
@ShaileshKumar-sm1ns
@ShaileshKumar-sm1ns 3 жыл бұрын
nice one
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks for watching Shailesh
@lrpbro6945
@lrpbro6945 9 ай бұрын
Hii sir , I have one JSON DATA file with datas in it. Now I want to EDIT or modify the DATAS OF VALUES from that json file , but I can't able to do that for JSON ARRAY, please give me some example to refer for that
@RaghavPal
@RaghavPal 9 ай бұрын
## Modifying data in a JSON file with an array There are various ways to modify data in a JSON file with an array, depending on your specific needs and programming language. Here are some examples: **1. Python:** ```python import json with open("data.json", "r") as f: data = json.load(f) # Accessing specific element in array data["array_name"][0]["key"] = "new_value" # Looping and modifying elements for item in data["array_name"]: if item["condition"]: item["key"] = "modified_value" # Updating the JSON file with open("data.json", "w") as f: json.dump(data, f, indent=4) ``` **2. JavaScript:** ```javascript const fs = require('fs'); const data = JSON.parse(fs.readFileSync('data.json', 'utf8')); // Accessing specific element in array data.arrayName[0].key = 'newValue'; // Looping and modifying elements data.arrayName.forEach(item => { if (item.condition) { item.key = 'modifiedValue'; } }); // Updating the JSON file fs.writeFileSync('data.json', JSON.stringify(data, null, 2)); ``` **3. Shell Script:** ```sh jq '.array_name[0].key = "new_value"' data.json > data_new.json ``` **4. JSON Online Tools:** Several online tools allow you to edit JSON data directly in your browser. You can search for "JSON editor" or "JSON online tool" to find one that suits your needs. **Additional Tips:** * Make sure you have the correct file path and access permissions. * Always back up your original JSON file before making any changes. * Use descriptive variable names and comments to improve code readability. * Consider using libraries or modules specifically designed for JSON manipulation for more complex tasks. These examples provide a basic framework for modifying data in a JSON file with an array. Remember to adapt the code to your specific data structure and desired modifications.
@Rajivrocks-Ltd.
@Rajivrocks-Ltd. 3 жыл бұрын
Can you use a JSON Schema to filter out unwanted data? So you have a huge JSON file you get from an endpoint but you just want 2 or 3 fields from it?
@RaghavPal
@RaghavPal 3 жыл бұрын
That is better done using JSON Path
@Rajivrocks-Ltd.
@Rajivrocks-Ltd. 3 жыл бұрын
@@RaghavPal ah okay thank you ill look into that!
@bpnpkate56
@bpnpkate56 2 жыл бұрын
I am new to JSON and in a schema file provided they have a mapping section with Definitions. Do you have any additional information or training on this part of JSON.
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi, not more that this as of now
@t.hemanthkumar7369
@t.hemanthkumar7369 10 ай бұрын
Hi sir how to convert one json schema to another different json schema in python code
@RaghavPal
@RaghavPal 10 ай бұрын
Hemanth To convert one JSON schema to another different JSON schema in Python code, you can use the following steps: 1. **Import the necessary libraries.** ```python import json import jsonschema ``` 2. **Load the source JSON schema.** ```python with open("source_schema.json", "r") as f: source_schema = json.load(f) ``` 3. **Validate the source JSON schema.** ```python jsonschema.validate(source_schema, jsonschema.Schema()) ``` 4. **Convert the source JSON schema to the new JSON schema.** ```python new_schema = jsonschema.Draft7Validator(source_schema).schema ``` 5. **Save the new JSON schema.** ```python with open("new_schema.json", "w") as f: json.dump(new_schema, f, indent=4) ``` Here is an example of a Python code that converts a JSON schema from Draft 4 to Draft 7: ```python import json import jsonschema # Load the source JSON schema. with open("source_schema.json", "r") as f: source_schema = json.load(f) # Validate the source JSON schema. jsonschema.validate(source_schema, jsonschema.Schema()) # Convert the source JSON schema to the new JSON schema. new_schema = jsonschema.Draft7Validator(source_schema).schema # Save the new JSON schema. with open("new_schema.json", "w") as f: json.dump(new_schema, f, indent=4) ``` You can use the same approach to convert JSON schemas from any draft to another draft.
@siddheshborse5416
@siddheshborse5416 2 жыл бұрын
What is the hotspot field in the post schema??
@RaghavPal
@RaghavPal 2 жыл бұрын
Not sure on this Siddhesh
@prabhumishra3323
@prabhumishra3323 3 жыл бұрын
Hi sir, since I did not get any contact information about you, so I am requesting in the comment.please create a series for chatbot test automation. Currently I might be working in a chatbot project where need to do functional and automation testing. Waiting for your reply.
@RaghavPal
@RaghavPal 3 жыл бұрын
Sure I will plan on this Prabhu
@prabhumishra3323
@prabhumishra3323 3 жыл бұрын
@@RaghavPal Thank you so much sir. I really need this tutorial.
@nazeermohammed3085
@nazeermohammed3085 3 жыл бұрын
Hi Raghav, Thanks How to achieve the same via automation using Java ?
@RaghavPal
@RaghavPal 3 жыл бұрын
I will plan a session Nazeer
@movimovimania5521
@movimovimania5521 2 жыл бұрын
Like you can create XML API samples from XML Schema can we create JSON API requests from JSON Schema?
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Movi, we can use JSON schema to annotate and validate json documents
@movimovimania5521
@movimovimania5521 2 жыл бұрын
@@RaghavPal Thanks what i meant is rolling out JSON API requests using JSON Schema, not just for validation / annotation
@RaghavPal
@RaghavPal 2 жыл бұрын
Not exactly, its for checking the format, structure. Basically it checks if your Json message conforms with the schema
@movimovimania5521
@movimovimania5521 2 жыл бұрын
@@RaghavPal right, so basically it's not similar to XML Schema where an XML schema is capable of populating an XML API request but JSON schema simply validates, but isn't capable of populating a sample JSON request ... that feels a bit odd considering JSON is so popular.
@RaghavPal
@RaghavPal 2 жыл бұрын
See you can generate a sample document, but will need to add the values and data www.liquid-technologies.com/online-schema-to-json-converter stackoverflow.com/questions/21894873/generate-sample-json-output-from-json-schema
@azkyakhan
@azkyakhan 3 жыл бұрын
Thanx
@RaghavPal
@RaghavPal 3 жыл бұрын
Welcome
@emrentoelluminiados
@emrentoelluminiados 3 ай бұрын
how can i find type and properties list?
@RaghavPal
@RaghavPal 3 ай бұрын
Emre Based on what i infer from your query.. In JSON Schema, you can define the type of a schema and specify its properties. Let's break it down: 1. Data Types: - JSON Schema defines several basic data types: - String: Represents text values. - Number: Includes both integers and floating-point numbers. - Object: Represents structured data with key-value pairs. - Array: Contains an ordered list of values. - Boolean: Represents true or false. - Null: Represents the absence of a value. 2. Example Schema: Here's a simple example of a JSON Schema that defines an object with a single property: ```json { "$schema": "json-schema.org/draft-04/schema", "title": "Product", "description": "A product from Acme's catalog", "type": "object", "properties": { "id": { "description": "The unique identifier for a product", "type": "integer" } }, "required": ["id"] } ``` In this schema: - The type is set to "object." - The "id" property is of type "integer." 3. Property Constraints: - You can add constraints to properties using keywords like `minimum`, `maximum`, `pattern`, and more. - For example, you can specify a numeric range for a property or require certain properties to be present. Remember to adapt these concepts to your specific use case --
@emrentoelluminiados
@emrentoelluminiados 3 ай бұрын
@@RaghavPal Thank you, it was very descriptive.
@greenmountain8986
@greenmountain8986 3 жыл бұрын
how would you validate in c#
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi, will try to create a session on that
@t.hemanthkumar7369
@t.hemanthkumar7369 10 ай бұрын
Please send me python code for me
@RaghavPal
@RaghavPal 10 ай бұрын
To convert one JSON schema to another different JSON schema in Python code, you can use the following steps: 1. **Import the necessary libraries.** ```python import json import jsonschema ``` 2. **Load the source JSON schema.** ```python with open("source_schema.json", "r") as f: source_schema = json.load(f) ``` 3. **Validate the source JSON schema.** ```python jsonschema.validate(source_schema, jsonschema.Schema()) ``` 4. **Convert the source JSON schema to the new JSON schema.** ```python new_schema = jsonschema.Draft7Validator(source_schema).schema ``` 5. **Save the new JSON schema.** ```python with open("new_schema.json", "w") as f: json.dump(new_schema, f, indent=4) ``` Here is an example of a Python code that converts a JSON schema from Draft 4 to Draft 7: ```python import json import jsonschema # Load the source JSON schema. with open("source_schema.json", "r") as f: source_schema = json.load(f) # Validate the source JSON schema. jsonschema.validate(source_schema, jsonschema.Schema()) # Convert the source JSON schema to the new JSON schema. new_schema = jsonschema.Draft7Validator(source_schema).schema # Save the new JSON schema. with open("new_schema.json", "w") as f: json.dump(new_schema, f, indent=4) ``` You can use the same approach to convert JSON schemas from any draft to another draft.
@Pareshbpatel
@Pareshbpatel Жыл бұрын
Nice introduction to JSON Schema. Thanks {2023-06-07}, {2023-12-11}
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Paresh
What is JSON ?
11:56
Telusko
Рет қаралды 1,1 МЛН
JSON Schema Validation in Python: Bring Structure Into JSON
13:45
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 6 МЛН
Angry Sigma Dog 🤣🤣 Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
Рет қаралды 49 МЛН
REST Assured Beginner Tutorial 10 | How to validate JSON Schema
13:11
Automation Step by Step
Рет қаралды 58 М.
Learn JSON Step-by-Step from Scratch
13:11
Automation Step by Step
Рет қаралды 104 М.
Ajv JSON schema validation
14:51
Jan Goebel
Рет қаралды 18 М.
JSON Schema Validation: How to Validate JSON Schema with Postman?
11:50
The Testing Academy
Рет қаралды 103 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
An Introduction to JSON Schema: A Practical Look
35:46
Erik Wilde
Рет қаралды 12 М.
JSON Crash Course
24:49
Traversy Media
Рет қаралды 1 МЛН
API Platform Conference 2021 - Samuel Rozé - Why JSON-LD and what is it?
42:21
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 6 МЛН