{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gunspec-io/json-schema/gunspec-io-data-report-schema.json",
  "title": "DataReport",
  "description": "A community-submitted data correction against a firearm.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gunspec-io-account-api-openapi.yml#/components/schemas/DataReport",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Opaque report id."
    },
    "firearmId": {
      "type": "string",
      "description": "Slug of the firearm this row belongs to."
    },
    "section": {
      "type": "string",
      "description": "Which part of the record the report is about."
    },
    "issueType": {
      "$ref": "#/$defs/ReportIssueType"
    },
    "description": {
      "type": "string",
      "description": "Prose summary of the record, where one has been written."
    },
    "suggestedValue": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the reporter believes the value should be."
    },
    "references": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pages the reporter cited in support."
    },
    "status": {
      "$ref": "#/$defs/ReportStatus"
    },
    "createdAt": {
      "type": "string",
      "description": "When the record was first added, `YYYY-MM-DD HH:MM:SS` in UTC."
    },
    "reviewedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When staff reviewed it, or null while it is pending."
    }
  },
  "required": [
    "id",
    "firearmId",
    "section",
    "issueType",
    "description",
    "status"
  ],
  "$defs": {
    "ReportIssueType": {
      "type": "string",
      "enum": [
        "incorrect",
        "missing",
        "outdated"
      ],
      "description": "What a data report says is wrong."
    },
    "ReportStatus": {
      "type": "string",
      "enum": [
        "pending",
        "reviewed",
        "resolved",
        "dismissed"
      ],
      "description": "Lifecycle of a data report."
    }
  }
}