Skip to content

open/generic

Title: Generic

Use Case: A flexible schema for storing arbitrary key-value data.

URL: https://dorsalhub.com/schemas/open/generic

This is a flexible, catch-all schema for storing custom key-value data that doesn't fit into any of the other specialized schemas.

  • Data Object: The core of the schema is a data object, which holds the custom key-value pairs.
  • Flexible Values: The values in the data object can be a string, number, boolean, or null.
  • Constraints: It is designed for simple, flat data and does not allow for nested objects.
  • Description: An optional description field can be used to explain what the custom data represents.
{
    "description": "Output from image quality analysis script v1.2",
    "data": {
        "is_blurry": false,
        "contrast_score": 0.87,
        "dominant_color_hex": "#1a4e8a",
        "resolution_width": 1920,
        "primary_subject": null
    }
}
{
    "_license": {
        "id": "Apache-2.0",
        "notice": "Copyright 2025 Dorsal Hub LTD",
        "url": "https://github.com/dorsalhub/open-validation-schemas/blob/main/LICENSE"
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://dorsalhub.com/schemas/open/generic",
    "title": "Generic",
    "version": "0.1.0",
    "description": "A flexible schema for storing arbitrary key-value data.",
    "type": "object",
    "properties": {
        "description": {
            "type": "string",
            "description": "Describe the data.",
            "maxLength": 1024
        },
        "producer": {
            "type": "string",
            "description": "The creator (model, tool or author) of this record.",
            "maxLength": 1024
        },
        "data": {
            "type": "object",
            "description": "An object containing custom key-value data. Nesting is disallowed.",
            "maxProperties": 128,
            "additionalProperties": {
                "anyOf": [
                    {
                        "type": "string",
                        "maxLength": 1024
                    },
                    {
                        "type": "number"
                    },
                    {
                        "type": "boolean"
                    },
                    {
                        "type": "null"
                    }
                ]
            }
        }
    },
    "required": [
        "data"
    ],
    "additionalProperties": false
}