Skip to content
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

Understand JSON Schema #3

Open
Gbahdeyboh opened this issue Mar 10, 2023 · 6 comments
Open

Understand JSON Schema #3

Gbahdeyboh opened this issue Mar 10, 2023 · 6 comments
Labels
difficulty-easy good first issue Good for newcomers json-schema question Further information is requested

Comments

@Gbahdeyboh
Copy link
Contributor

JSON Schema is a powerful tool for validating the structure of JSON data. The collection format specification is written in JSON Schema. The schema is publicly available and can be found here.

To be successful in this project, it is essential to have a basic understanding of JSON schema. An excellent place to get started is here. You do not need to spend an enormous amount of time deep diving into this resource. Having a basic understanding of JSON schema is sufficient for now.

When you're done, in the comment section of this issue, highlight the three reasons why you think JSON validation is important and how JSON schema solves this.

@Gbahdeyboh Gbahdeyboh added good first issue Good for newcomers difficulty-easy json-schema question Further information is requested labels Mar 10, 2023
@tdadadavid
Copy link

@Gbahdeyboh I am interested in this project

  • Why is JSON validation is important?
  1. It ensures data integrity and consistency across systems that interact together.
  2. It ensures efficiency between systems interacting with JSON formats since large amounts of data don't need to be processed if the data is not valid
  3. It ensures data is secured (for example using regex for pattern matching to ensure the provided string is the expected string)
  • How JSON Schema solves the problem?
  1. Using JSON schema intuitive type system, restrictions, and constraints can be enforced
  2. Its pattern-matching feature via regex makes the data secured (eg ensuring the string passed is not an SQL script for code injection)
  3. Its ease of use contributes also.

@siva-kumar-s
Copy link

siva-kumar-s commented Mar 16, 2023

@Gbahdeyboh Hello, my name is Sivakumar S you can call me siva and I am a Junior Full Stack Developer. As a part of my daily work, I build APIs for various applications and I use Postman for testing them. I am quite proficient in using Postman and I am very interested and excited to contribute to its development.

  • What is Json Schema
    It define the expected data types and format of each field in the Json.

  • What is Json Validation
    It validate the give JSON Object with the Json Schema, it check JSON Object it in the proper sturcture and format as we defined in the JSON Schema.

Why JSON validation is important

  1. It ensures that the data conforms to a specific format and structure as we defined in the JSON schema.
  2. It ensures the data is compatible with our application to process the data.
  3. It ensure make the application secure only proper and valid data is processed to the application.

How JSON Schema Solve the problem

  1. Using JSON Schema we define what type JSON format we need for our application, so only exact format of JSON Object is processed to our application.
  2. Developer don't need to check manually in the Big JSON Object, if any key is missing or invalid data type in the JSON Object it can easily figure out and fix it.
  3. It is compatible with Different system and application by providing a common language for describing JSON data.

@yashm277
Copy link

Here are three reasons why JSON validation is important and how JSON schema solves them:

Firstly I'll just explain my understanding of JSON Schema and Validation.

JSON validation is the process of checking if a JSON data object is valid or conforms to a defined structure or schema. JSON (JavaScript Object Notation) is a lightweight data-interchange format used to transmit data between applications and systems. JSON Schema is only one way of doing JSON Validation.
JSON Schema itself is written in JSON. It is data itself, not a computer program. It’s just a declarative format for “describing the structure of other data”. This is both its strength and its weakness (which it shares with other similar schema languages). It is easy to concisely describe the surface structure of data, and automate validating data against it. However, since a JSON Schema can’t contain arbitrary code, there are certain constraints on the relationships between data elements that can’t be expressed.

  1. Ensuring data consistency and accuracy:
    JSON validation helps to ensure that the data being passed between different applications or systems is consistent and accurate. It ensures that the data adheres to a specific format and structure, preventing errors or inconsistencies that could lead to issues with data processing or analysis.
    JSON schema provides a standardised way to define the structure and format of JSON data, making it easier to validate and ensure consistency.

  2. Improving data quality:
    JSON validation can also help to improve the quality of data being exchanged between different applications or systems. By enforcing specific rules and constraints on the data, such as data types, minimum and maximum values, and required fields, JSON schema can help to identify and flag potential issues with the data before they cause problems down the line.

  3. Enhancing security:
    JSON validation is also important for security reasons. By validating incoming JSON data, you can ensure that it is free from malicious code or other security vulnerabilities that could compromise your system.
    JSON schema provides a way to define and enforce data validation rules, which can help to prevent attacks such as injection attacks or cross-site scripting.

In summary, JSON validation is important for ensuring data consistency, improving data quality, and enhancing security. JSON schema provides a standardised way to define and enforce data validation rules, making it easier to ensure that incoming JSON data is valid, accurate, and secure.

@Gbahdeyboh I am interested in this project. Would appreciate if you could react to this or give feedback. Thanks !

@Huzaifa785
Copy link

Hey @Gbahdeyboh 👋🏻

It's actually a good idea that we are starting from the very basics. So, let me just explain why JSON validation is important and how JSON schema solves this.

  1. Ensuring Data Consistency:
    JSON validation ensures that data conforms to a specific structure or format.
  • How JSON schema solves this?
    JSON Schema provides a standardized way of defining and validating the structure of JSON data.
  1. Detecting Errors Early:
    Validating JSON data before processing it can help to detect errors early in the development process. This reduces the time and effort required to debug and fix errors that may arise due to invalid data.
  • How JSON schema solves this?
    JSON Schema enables developers to define validation rules that can be applied to JSON data, making it easy to detect errors early on.
  1. Improving Security:
    JSON validation can also help to improve security by preventing attacks that exploit vulnerabilities in data processing or storage. By validating JSON data against predefined rules, it is possible to detect malicious or unexpected data that may cause security issues. For example, let's say you have an application that receives JSON data from an external API. The JSON data contains sensitive information, such as user credentials, that must be protected. You want to ensure that the data received by your application is encrypted and conforms to specific security standards, for the same we can use JSON schema.
  • How JSON schema solves this?
    JSON Schema enables developers to define rules that can be used to validate JSON data against specific security requirements or standards.

Super excited to work on this project @Gbahdeyboh . Have shared my ideas that we can include in this project on this repo .

If there are any mailing lists, forums or upcoming meet ups, please let me know.

@jaydip1235
Copy link

Hi @Gbahdeyboh
The three reasons why you think JSON validation is important:
1. Data Integrity : JSON validation is essential in ensuring that the data being transmitted or stored conforms to a specific format, structure, and set of rules. This consistency helps maintain the integrity of the data and avoid data corruption and errors.
2. Improves interoperability: JSON schema validation helps ensure that data being exchanged between different systems adheres to a common set of rules, thus improving interoperability. It ensures that the data is not only consistent but also easily interpretable by different systems.
3. Preventing threats: JSON schema validation can help identify and prevent potential security threats such as injection attacks and data tampering.

JSON schema solves the above problems by providing a standardized way to define the expected structure, properties, and constraints of JSON data. JSON schema allows users to define a schema for their JSON data and then validate incoming JSON data against that schema to ensure it meets the expected requirements.

I am looking forward to contribute to this project!

Thank you
Jaydip Dey

@KaalaAadmi
Copy link

Hello @Gbahdeyboh

JSON schema provides a standardized way to define the structure, format, and validation rules for JSON data, making it easier to validate and maintain data quality, prevent errors, and promote interoperability.

The three reasons why JSON validation is important and how JSON schema solves them:

Ensuring Data Quality: JSON validation is essential for ensuring the consistency and quality of the data. With the help of JSON validation, developers can ensure that the format is as they expect it to be along with the rules they define in the schema. Thus, JSON schema provides a standardized and well-accepted method to define the structure, format, and data types of JSON data, making it easier to understand, validate and maintain data quality.

Preventing Errors: Validating JSON data can help prevent errors in data processing and manipulation. By ensuring that the data adheres to a specific structure and set of rules, developers can avoid errors caused by unexpected data formats or values. JSON schema provides a way to define validation rules, such as minimum and maximum values, required fields, and allowed data types, which can help prevent errors in the data processing.

Promoting Interoperability: JSON validation is essential for promoting interoperability between different systems and applications. By defining a standardized schema for JSON data, developers can ensure that the data can be shared and used across different platforms and applications. JSON schema provides a standardized way to define the structure and format of JSON data, making it easier to share and use data across different systems and applications.

@Gbahdeyboh, please let me know if my understanding is correct and if I missed out on a few points.

Looking forward to contributing to this project.

Thanks,
Arnav Bhattacharya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty-easy good first issue Good for newcomers json-schema question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants