{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api-fiddle.com/schemas/specification.json",
  "title": "API Fiddle Specification",
  "description": "An API specification within an API Fiddle project, representing an OpenAPI document being designed or edited.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the specification."
    },
    "projectId": {
      "type": "string",
      "description": "Identifier of the parent project."
    },
    "name": {
      "type": "string",
      "description": "Name of the specification.",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "description": "A detailed description of the specification."
    },
    "version": {
      "type": "string",
      "description": "Version label for the specification."
    },
    "format": {
      "type": "string",
      "enum": ["openapi-3.0", "openapi-3.1"],
      "description": "The OpenAPI format version used by this specification."
    },
    "content": {
      "type": "string",
      "description": "The raw specification content in YAML or JSON."
    },
    "status": {
      "type": "string",
      "enum": ["draft", "review", "published", "archived"],
      "description": "Current lifecycle status of the specification.",
      "default": "draft"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the specification was created."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the specification was last updated."
    }
  },
  "required": ["id", "projectId", "name"],
  "additionalProperties": false
}
