JSON Schema enables the confident and reliable use of the JSON data format, bringing consistency, validity, and interoperability to enterprise operations. JSON Schema defines the digital objects that we post to APIs, and receive as responses. JSON Schema defines the payloads of our APIs, but it also defines the surface area of our APIs as part of the OpenAPI specification. JSON Schema is ubiquitous in all enterprise organizations, bringing the following benefits to operations. * **API Schema** - Acts as a form of self-documentation for APIs, making it easier for developers to understand the expected data format and structure. * **API Validation** - Ensures incoming or outgoing JSON data conforms to a predefined structure, reducing errors and improving data integrity. * **API Interoperability** - Provides a standardized way to describe data formats, ensuring compatibility between systems using JSON for data exchange. * **API Automation** - Allows for code generation, form validation, and testing tools to work seamlessly by leveraging schema definitions. JSON Schema provides these four basic building blocks that can be used to define and validate every aspect of enterprise API operations, helping teams be more precise and consistent when it comes to the requests made to APIs, as well as the responses that are returned. * **Identifiers** (URL reference to each schema) * **Types** (string, number, boolean, object, array, null) * **Metadata** (title, names, descriptions) * **Constraints** (minimum, maximum, required fields) * **Properties** (required and optional properties) * **Patterns** (regex-based validation for strings) * **Structure** (nested or references) JSON Schema is a standardized and flexible way to validate, document, and enforce structure across your JSON data. It simplifies API design, enhances reliability, and reduces errors, making it a foundational specification for any API operation. APIs.json, OpenAPI, Spectral, and other commonly used API specifications all also use JSON Schema to validate the compliance with their specification, further baking it into API operations. The inventory and refinement of JSON Schema and publishing them to Git repositories and/or publishing them to schema registries help encourage reuse and is the number one thing you can do to stabilize API operations. Ensuring that the latest version of the JSON Specification is in use across teams, with validators baked into build pipelines, and even API gateways in some cases, will all contribute to the stability and security of the API surface area of any enterprise.
JSON Schema
Resources
Related Rules
JSON Schema Draft 2020-12 Description Error
Each JSON Schema object MUST include a description that explains, in plain language, the purpose and function of the object. This description should provide a clear overview of how the object is in...
JSON Schema Draft 2020-12 Description Info
Each JSON Schema object MUST include a description that explains, in plain language, the purpose and function of the object. This description should provide a clear overview of how the object is in...
JSON Schema Draft 2020-12 Description Length Error
The description for any JSON Schema object needs to be concise, making sure it remains easy to read and understand for anyone using or interpreting it. This approach helps keep the schema self-cont...
JSON Schema Draft 2020-12 Description Length Info
The description for any JSON Schema object needs to be concise, making sure it remains easy to read and understand for anyone using or interpreting it. This approach helps keep the schema self-cont...
JSON Schema Draft 2020-12 ID Error
Each JSON Schema object MUST have a unique identifier, represented as a URL pointing to its location. The $id property in JSON Schema is used to establish the source of truth for any object being d...
JSON Schema Draft 2020-12 ID Info
Each JSON Schema object MUST have a unique identifier, represented as a URL pointing to its location. The $id property in JSON Schema is used to establish the source of truth for any object being d...
JSON Schema Draft 2020-12 ID Source URL Error
The $id property in any JSON Schema MUST contain a valid URL pointing to a central registry, repository, or another authoritative source for the object. This URL so that the object's source is alwa...
JSON Schema Draft 2020-12 ID Source URL Info
The $id property in any JSON Schema MUST contain a valid URL pointing to a central registry, repository, or another authoritative source for the object. This URL so that the object's source is alwa...
JSON Schema Draft 2020-12 Properties Allowed Integer Format Error
Schema integer properties needs a format property with int32 or int64 applied
JSON Schema Draft 2020-12 Properties Allowed Number Format Error
Schema integer properties needs a format property with int32 or int64 applied
JSON Schema Draft 2020-12 Properties Array Items Error
Schema properties that are of the type array must have an items property defined
JSON Schema Draft 2020-12 Properties Array Items Info
Schema properties that are of the type array must have an items property defined
JSON Schema Draft 2020-12 Properties Array Maxitems Error
Schema properties that are of the type array needs a max items property defined
JSON Schema Draft 2020-12 Properties Array Maxitems Info
Schema properties that are of the type array needs a max items property defined
JSON Schema Draft 2020-12 Properties Array Minitems Error
Schema properties that are of the type array needs a min items property defined
JSON Schema Draft 2020-12 Properties Array Minitems Info
Schema properties that are of the type array needs a min items property defined
JSON Schema Draft 2020-12 Properties Define Number Maximum Error
Schema properties that are of the type number needs a maximum property defined
JSON Schema Draft 2020-12 Properties Define Number Minimum Error
Schema properties that are of the type number needs a minimum property defined
JSON Schema Draft 2020-12 Properties Descriptions Error
Schema properties needs descriptions that provide a narrative of the property contains, and how it can be used
JSON Schema Draft 2020-12 Properties Descriptions Info
Schema properties needs descriptions that provide a narrative of the property contains, and how it can be used
JSON Schema Draft 2020-12 Properties Descriptions Length Error
Schema property descriptions needs a length limit applied, applying constraints to writing descriptions, and keeping consistent across APIs
JSON Schema Draft 2020-12 Properties Enum Casing Error
Schema property enumerators are consistent casing, keeping all entries upper snake case, and consistent across all APIs
JSON Schema Draft 2020-12 Properties Enum Casing Info
Schema property enumerators are consistent casing, keeping all entries upper snake case, and consistent across all APIs
JSON Schema Draft 2020-12 Properties Enum Info
Schema property has enumerators, giving consistent values chosen by consumers when making requests
JSON Schema Draft 2020-12 Properties Error
Schema has properties, giving more detail regarding the structure of each schema being applied as part of a request or a response
JSON Schema Draft 2020-12 Properties Info
Schema has properties, giving more detail regarding the structure of each schema being applied as part of a request or a response
JSON Schema Draft 2020-12 Properties Names Camel Case Error
Schema property names are camel case, giving consistent casing across all the schema properties used by APIs
JSON Schema Draft 2020-12 Properties Names Camel Case Info
Schema property names are camel case, giving consistent casing across all the schema properties used by APIs
JSON Schema Draft 2020-12 Properties Names Length Error
Schema property names have a length restriction applied, keeping names consistent, and avoiding being too long
JSON Schema Draft 2020-12 Properties String Maxlength Error
Schema properties that are of the string type have the max length applied defining the shape of the property
JSON Schema Draft 2020-12 Properties String Maxlength Info
Schema properties that are of the string type have the max length applied defining the shape of the property
JSON Schema Draft 2020-12 Properties String Minlength Error
Schema properties that are of the string type have the min length applied defining the shape of the property
JSON Schema Draft 2020-12 Properties String Minlength Info
Schema properties that are of the string type have the min length applied defining the shape of the property
JSON Schema Draft 2020-12 Required Error
All JSON Schema objects should explicitly define their properties and include at least one required property. Defining required properties enhances the accuracy and reliability of validation for ea...
JSON Schema Draft 2020-12 Required Info
All JSON Schema objects should explicitly define their properties and include at least one required property. Defining required properties enhances the accuracy and reliability of validation for ea...
JSON Schema Draft 2020-12 Schema Draft Error
The $schema property in a JSON Schema MUST always reference the latest draft of the specification to ensure consistent validation across all objects. Using the most up-to-date version of the specif...
JSON Schema Draft 2020-12 Schema Draft Info
The $schema property in a JSON Schema MUST always reference the latest draft of the specification to ensure consistent validation across all objects. Using the most up-to-date version of the specif...
JSON Schema Draft 2020-12 Schema Error
JSON Schema objects should always include the $schema property to explicitly indicate which version of the specification is being used. This property is essential for tooling and should consistentl...
JSON Schema Draft 2020-12 Schema Info
JSON Schema objects should always include the $schema property to explicitly indicate which version of the specification is being used. This property is essential for tooling and should consistentl...
JSON Schema Draft 2020-12 Title Error
JSON Schema objects MUST include a title property that describes the object in plain language while reflecting the object's file name. The title should convey the object's content and purpose, givi...
JSON Schema Draft 2020-12 Title Info
JSON Schema objects MUST include a title property that describes the object in plain language while reflecting the object's file name. The title should convey the object's content and purpose, givi...
JSON Schema Draft 2020-12 Title Length Error
The title of JSON Schema objects needs to be concise yet accurately describe the object's purpose. Keeping the title short ensures clarity and minimizes downstream impact on other items using the o...
JSON Schema Draft 2020-12 Title Length info
The title of JSON Schema objects needs to be concise yet accurately describe the object's purpose. Keeping the title short ensures clarity and minimizes downstream impact on other items using the o...
JSON Schema Draft 2020-12 Title Pascal Case Error
The name of a JSON Schema object should always be in PascalCase to ensure readability and consistency across APIs. Using PascalCase helps maintain uniformity and aligns the object's name with its p...
JSON Schema Draft 2020-12 Title Pascal Case Info
The name of a JSON Schema object should always be in PascalCase to ensure readability and consistency across APIs. Using PascalCase helps maintain uniformity and aligns the object's name with its p...
JSON Schema Draft 2020-12 Type Error
JSON Schema objects should explicitly define their type, making sure clarity about each object's structure. This allows tools utilizing the schema to accurately validate the object wherever it is a...
JSON Schema Draft 2020-12 Type Info
JSON Schema objects should explicitly define their type, making sure clarity about each object's structure. This allows tools utilizing the schema to accurately validate the object wherever it is a...