{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.example.com/schemas/scenario.json",
  "title": "Scenario",
  "type": "object",
  "description": "A Gherkin BDD scenario that automates verification of an acceptance criterion",
  "required": [
    "id",
    "title",
    "featureFile"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the scenario"
    },
    "storyId": {
      "type": "string",
      "description": "ID of the parent user story"
    },
    "criterionId": {
      "type": "string",
      "description": "ID of the linked acceptance criterion"
    },
    "title": {
      "type": "string",
      "description": "Scenario title as it appears in the feature file"
    },
    "featureFile": {
      "type": "string",
      "description": "Path to the Gherkin feature file containing this scenario"
    },
    "gherkin": {
      "type": "string",
      "description": "Full Gherkin text of the scenario including Given/When/Then steps"
    },
    "status": {
      "type": "string",
      "description": "Latest test execution status",
      "enum": [
        "pending",
        "passing",
        "failing",
        "skipped"
      ]
    },
    "lastRunAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of the most recent test execution"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the scenario was created"
    }
  }
}