JSON reference
{ }
JSON Syntax
JSON is a text format built from two structures: objects of key/value pairs and ordered lists of values.
{ }
JSON Data Types
JSON has six value types: object, array, string, number, boolean and null.
{ }
JSON Errors
Most JSON errors come from a small set of syntax problems. Learn what they mean and how to fix them.
{ }
JSON Examples
These samples show common JSON shapes for APIs, applications and configuration files.
{ }
JSON Schema Guide
JSON Schema describes the shape of JSON data and can validate documents automatically.
{ }
JSONPath Guide
JSONPath is a query language for selecting values from JSON documents.
{ }
Unexpected Token JSON Error
The parser found a character it did not expect, usually an unquoted key or value.
{ }
Unexpected End of JSON Input
The document ends before every object and array is closed.
{ }
Trailing Comma JSON Error
A comma after the final item is not valid JSON.
{ }
Invalid Character JSON Error
Control characters and unsupported symbols must be escaped inside strings.
{ }
Unclosed Object JSON Error
An object starts but never gets its closing brace.
{ }
Unclosed Array JSON Error
An array starts but never gets its closing bracket.
{ }
User JSON Example
A common user object for profiles, directories and API payloads.
{ }
Product JSON Example
A typical product object for e-commerce and catalogs.
{ }
Order JSON Example
A standard order object for checkout and order history.
{ }
API Response JSON Example
A stable response envelope for JSON APIs.
{ }
Address JSON Example
A reusable address object for shipping, billing and location data.
{ }
JSON in JavaScript
JavaScript has native JSON.parse and JSON.stringify support.
{ }
JSON in Python
Python provides json.loads and json.dumps for JSON work.
{ }
JSON in Java
Jackson is the most common library for JSON in Java.
{ }
JSON in C#
System.Text.Json is the modern built-in JSON library for C#.
{ }
JSON in Go
Go includes encoding/json in its standard library.
{ }
JSON Schema type Keyword
The type keyword defines the allowed JSON value type.
{ }
JSON Schema properties Keyword
The properties keyword describes the allowed fields of an object.
{ }
JSON Schema required Keyword
The required keyword lists keys that must exist.
{ }
JSON Schema items Keyword
The items keyword describes the schema for array elements.
{ }
JSON Schema enum Keyword
The enum keyword allows only values from a fixed list.
{ }
JSON Schema const Keyword
The const keyword requires the value to equal exactly one constant.
{ }
JSON Schema oneOf Keyword
The value must match exactly one of the listed schemas.
{ }
JSON Schema anyOf Keyword
The value must match at least one of the listed schemas.
{ }
JSON Schema allOf Keyword
The value must match every listed schema.
{ }
JSON Schema $ref Keyword
The $ref keyword points to another schema definition.
{ }
JSONPath Root Expression
The root expression $ represents the whole JSON document.
{ }
JSONPath Child Operator
The dot operator selects a child property.
{ }
JSONPath Array Index
Bracket notation selects array items by index.
{ }
JSONPath Wildcard
The * wildcard matches all children.
{ }
JSONPath Filter Expression
Filters use [?(@.key operator value)].
{ }
JSONPath Recursive Descent
Recursive descent searches anywhere below the current node.
{ }
Company JSON Example
A practical company record for directories and org data.
{ }
Employee JSON Example
A common employee record for HR and directory systems.
{ }
Customer JSON Example
A customer record used by CRM, checkout and support systems.
{ }
Configuration JSON Example
A practical config structure for applications and services.
{ }
JSON Schema pattern Keyword
The pattern keyword applies a regex to string values.
{ }
JSON Schema minimum Keyword
The minimum keyword requires a number to be greater than or equal to a value.
{ }
JSON Schema format Keyword
The format keyword describes a semantic string format.
{ }
JSONPath Slice
Slice uses [start:end] to select a range.
{ }
JSONPath Union
Union uses [0,1] to select multiple positions.
{ }
JSONPath Bracket Notation
Bracket notation uses quotes for keys with spaces or symbols.
{ }
JSON vs YAML
JSON is strict data interchange; YAML adds comments and compact indentation.
{ }
JSON vs XML
JSON is lighter and maps directly to objects; XML supports attributes and namespaces.
{ }
JSON vs CSV
CSV is compact for tables; JSON preserves types and nested structures.
{ }
JSON Schema additionalProperties Keyword
additionalProperties decides whether undeclared keys are allowed.
{ }
JSON Schema maxLength Keyword
maxLength caps the number of characters in a string.
{ }
JSON Schema minLength Keyword
minLength sets the minimum number of characters.
{ }
JSON Schema maxItems Keyword
maxItems caps the number of items in an array.
{ }
JSON Schema minItems Keyword
minItems sets the minimum number of items.
{ }
JSON Schema multipleOf Keyword
multipleOf ensures a number is divisible by a given value.
{ }
JSON Schema exclusiveMinimum Keyword
exclusiveMinimum rejects the boundary value itself.
{ }
JSONPath Equality Operator
The equality operator selects nodes with an exact value.
{ }
JSONPath Comparison Operators
Comparison operators select nodes by numeric ranges.
{ }
JSONPath Logical AND
Logical AND requires every condition to be true.
{ }
JSONPath Logical OR
Logical OR requires at least one condition to be true.
{ }
JSONPath Negation Operator
Negation inverts a filter condition.
{ }
JSONPath Regex Filter
The regex operator tests a string against a pattern.
{ }
Order Item JSON Example
A reusable line item for carts, orders and invoices.
{ }
Category JSON Example
A common tree node for navigation and product catalogs.
{ }
Event JSON Example
A standard event envelope for analytics and webhooks.
{ }
Comment JSON Example
A comment record for forums, articles and product reviews.
{ }
Setting JSON Example
A flexible setting record for preferences and feature flags.