-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is a JSON Schema and why is it useful? How do I create/use a JSON Schema? #1
Comments
JSON SCHEMAJSON schema is a powerful tool for validating the structure of JSON data. But what does it actually mean in layman's term? What is JSON?
{
“key1”: “value1”,
“key2”: “value2”,
} What is a JSON schema?
E.G. Expected Object: {
“type”: “object”,
“properties”: {
“first name”: { “type”: “string” },
“last name”: { “type”: “string” },
“age” : { “type”: “number” }
}
} Now if the submit a the following object: ✖️ It would fail the validation that we have put in place. {
“first name”:”Mickey”,
“last name”: “Mouse”
} But, the following object: ✔️ It would pass the validation. {
“first name”:”Mickey”,
“last name”: “Mouse”,
“age”: 100
} There we have our first JSON Schema for validation purposes! 😄 |
@sohilpandya edit "first name" to "last name" in the Expected Object as u have written it twice 😄 |
Thanks! @deadcoder0904 😄 |
Answer the question that is obviously on everyone's mind... 😉
The text was updated successfully, but these errors were encountered: