Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 677 Bytes

schemasdraft.md

File metadata and controls

32 lines (27 loc) · 677 Bytes

Example Schema 1: Array with Mixed Types

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/product-schema.json",
  "type": "array",
  "items": {
    "anyOf": [
      { "type": "integer" },
      {
        "type": "array",
        "items": { "type": "integer" }
      }
    ]
  }
}

This schema defines an array where each item can either be an integer or an array of integers.

Example Schema 2: Array of Integers

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/product-schema.json",
  "type": "array",
  "items": { "type": "integer" }
}