Skip to content

Instantly share code, notes, and snippets.

@subfuzion
Created August 4, 2015 22:39
Show Gist options
  • Save subfuzion/3e4b5e3866595de95b1e to your computer and use it in GitHub Desktop.
Save subfuzion/3e4b5e3866595de95b1e to your computer and use it in GitHub Desktop.
Simple schema example from the JSON Schema website

Simple schema example from the JSON Schema website example page:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Product",
    "description": "A product from Acme's catalog",

    "type": "object",
    
    "properties": {
        "id": {
            "description": "The unique identifier for a product",
            "type": "integer"
        },
        "name": {
            "description": "Name of the product",
            "type": "string"
        },
        "price": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "minItems": 1,
            "uniqueItems": true
        }
    },
    
    "required": ["id", "name", "price"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment