{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wimsta-com/json-schema/wimsta-com-registry-schema.json",
  "title": "Registry",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/wimsta-com-api-openapi.json#/components/schemas/Registry",
  "type": "object",
  "required": [
    "registry_version",
    "license",
    "formulas"
  ],
  "properties": {
    "registry_version": {
      "type": "string"
    },
    "last_updated": {
      "type": "string",
      "format": "date"
    },
    "license": {
      "type": "string"
    },
    "attribution_notice": {
      "type": "string"
    },
    "canonical_page": {
      "type": "string",
      "format": "uri"
    },
    "formula_count": {
      "type": "integer"
    },
    "formulas": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Formula"
      }
    }
  },
  "$defs": {
    "Formula": {
      "type": "object",
      "required": [
        "id",
        "name",
        "category",
        "equation",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "equation": {
          "type": "string",
          "description": "Human-readable equation"
        },
        "inputs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source": {
          "type": "object",
          "properties": {
            "authors": {
              "type": "string"
            },
            "year": {
              "type": "integer"
            },
            "journal": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "sample": {
          "type": "object",
          "description": "Derivation sample",
          "additionalProperties": true
        },
        "error": {
          "type": "object",
          "description": "Reported error of the equation",
          "additionalProperties": true
        },
        "verification": {
          "type": "string",
          "description": "How the coefficients were checked against the source"
        },
        "independent_derivation": {
          "type": "boolean"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "canonical_page": {
          "type": "string",
          "format": "uri"
        },
        "coefficients": {
          "type": "object",
          "description": "Coefficients keyed by term; values are numbers, or nested objects for sex-specific equations",
          "additionalProperties": true
        },
        "sex_coding": {
          "type": "string"
        },
        "units": {
          "type": "string"
        }
      }
    }
  }
}