JSON reference

JSON SyntaxJSON is a text format built from two structures: objects of key/value pairs and ordered lists of values.JSON Data TypesJSON has six value types: object, array, string, number, boolean and null.JSON ErrorsMost JSON errors come from a small set of syntax problems. Learn what they mean and how to fix them.JSON ExamplesThese samples show common JSON shapes for APIs, applications and configuration files.JSON Schema GuideJSON Schema describes the shape of JSON data and can validate documents automatically.JSONPath GuideJSONPath is a query language for selecting values from JSON documents.Unexpected Token JSON ErrorThe parser found a character it did not expect, usually an unquoted key or value.Unexpected End of JSON InputThe document ends before every object and array is closed.Trailing Comma JSON ErrorA comma after the final item is not valid JSON.Invalid Character JSON ErrorControl characters and unsupported symbols must be escaped inside strings.Unclosed Object JSON ErrorAn object starts but never gets its closing brace.Unclosed Array JSON ErrorAn array starts but never gets its closing bracket.User JSON ExampleA common user object for profiles, directories and API payloads.Product JSON ExampleA typical product object for e-commerce and catalogs.Order JSON ExampleA standard order object for checkout and order history.API Response JSON ExampleA stable response envelope for JSON APIs.Address JSON ExampleA reusable address object for shipping, billing and location data.JSON in JavaScriptJavaScript has native JSON.parse and JSON.stringify support.JSON in PythonPython provides json.loads and json.dumps for JSON work.JSON in JavaJackson 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 GoGo includes encoding/json in its standard library.JSON Schema type KeywordThe type keyword defines the allowed JSON value type.JSON Schema properties KeywordThe properties keyword describes the allowed fields of an object.JSON Schema required KeywordThe required keyword lists keys that must exist.JSON Schema items KeywordThe items keyword describes the schema for array elements.JSON Schema enum KeywordThe enum keyword allows only values from a fixed list.JSON Schema const KeywordThe const keyword requires the value to equal exactly one constant.JSON Schema oneOf KeywordThe value must match exactly one of the listed schemas.JSON Schema anyOf KeywordThe value must match at least one of the listed schemas.JSON Schema allOf KeywordThe value must match every listed schema.JSON Schema $ref KeywordThe $ref keyword points to another schema definition.JSONPath Root ExpressionThe root expression $ represents the whole JSON document.JSONPath Child OperatorThe dot operator selects a child property.JSONPath Array IndexBracket notation selects array items by index.JSONPath WildcardThe * wildcard matches all children.JSONPath Filter ExpressionFilters use [?(@.key operator value)].JSONPath Recursive DescentRecursive descent searches anywhere below the current node.Company JSON ExampleA practical company record for directories and org data.Employee JSON ExampleA common employee record for HR and directory systems.Customer JSON ExampleA customer record used by CRM, checkout and support systems.Configuration JSON ExampleA practical config structure for applications and services.JSON Schema pattern KeywordThe pattern keyword applies a regex to string values.JSON Schema minimum KeywordThe minimum keyword requires a number to be greater than or equal to a value.JSON Schema format KeywordThe format keyword describes a semantic string format.JSONPath SliceSlice uses [start:end] to select a range.JSONPath UnionUnion uses [0,1] to select multiple positions.JSONPath Bracket NotationBracket notation uses quotes for keys with spaces or symbols.JSON vs YAMLJSON is strict data interchange; YAML adds comments and compact indentation.JSON vs XMLJSON is lighter and maps directly to objects; XML supports attributes and namespaces.JSON vs CSVCSV is compact for tables; JSON preserves types and nested structures.JSON Schema additionalProperties KeywordadditionalProperties decides whether undeclared keys are allowed.JSON Schema maxLength KeywordmaxLength caps the number of characters in a string.JSON Schema minLength KeywordminLength sets the minimum number of characters.JSON Schema maxItems KeywordmaxItems caps the number of items in an array.JSON Schema minItems KeywordminItems sets the minimum number of items.JSON Schema multipleOf KeywordmultipleOf ensures a number is divisible by a given value.JSON Schema exclusiveMinimum KeywordexclusiveMinimum rejects the boundary value itself.JSONPath Equality OperatorThe equality operator selects nodes with an exact value.JSONPath Comparison OperatorsComparison operators select nodes by numeric ranges.JSONPath Logical ANDLogical AND requires every condition to be true.JSONPath Logical ORLogical OR requires at least one condition to be true.JSONPath Negation OperatorNegation inverts a filter condition.JSONPath Regex FilterThe regex operator tests a string against a pattern.Order Item JSON ExampleA reusable line item for carts, orders and invoices.Category JSON ExampleA common tree node for navigation and product catalogs.Event JSON ExampleA standard event envelope for analytics and webhooks.Comment JSON ExampleA comment record for forums, articles and product reviews.Setting JSON ExampleA flexible setting record for preferences and feature flags.