Skip to content
Novus Examples
json589 B

Product JSON Schema (draft-07)

A JSON Schema (draft-07) describing a product object, with required fields, types, and constraints — paired with a conforming and a deliberately non-conforming instance for testing validators.

Preview — first 36 linesjson
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Product",
  "type": "object",
  "required": [
    "product_id",
    "name",
    "price",
    "in_stock"
  ],
  "properties": {
    "product_id": {
      "type": "integer",
      "minimum": 1
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "price": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "in_stock": {
      "type": "boolean"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}

Specifications

Spec
JSON Schema draft-07
Required
product_id, name, price, in_stock
Additional Properties
false

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

Generated by generation/data_realworld.py. Free for any use, no attribution required — license.