TypeSpec · Schema

TypeSpec Program

Represents a compiled TypeSpec program with resolved types and diagnostic information

API DesignCode GenerationOpenAPIProtocol BuffersSpecification Language

Properties

Name Type Description
projectRoot string Absolute path to the TypeSpec project root directory
compilerOptions object Compiler options used for this compilation
diagnostics array Compilation diagnostics (errors and warnings)
View JSON Schema on GitHub

JSON Schema

typespec-program-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://typespec.io/schemas/program",
  "title": "TypeSpec Program",
  "description": "Represents a compiled TypeSpec program with resolved types and diagnostic information",
  "type": "object",
  "properties": {
    "projectRoot": {
      "type": "string",
      "description": "Absolute path to the TypeSpec project root directory"
    },
    "compilerOptions": {
      "type": "object",
      "description": "Compiler options used for this compilation",
      "properties": {
        "outputDir": {"type": "string"},
        "emit": {
          "type": "array",
          "items": {"type": "string"},
          "description": "List of emitter package names to run"
        },
        "options": {
          "type": "object",
          "description": "Per-emitter options keyed by emitter package name"
        },
        "linterRuleSet": {"type": "object"},
        "warningAsError": {"type": "boolean"},
        "trace": {
          "type": "array",
          "items": {"type": "string"}
        }
      }
    },
    "diagnostics": {
      "type": "array",
      "description": "Compilation diagnostics (errors and warnings)",
      "items": {
        "type": "object",
        "properties": {
          "code": {"type": "string"},
          "message": {"type": "string"},
          "severity": {"type": "string", "enum": ["error", "warning", "message"]},
          "target": {"type": "object"},
          "url": {"type": "string"}
        }
      }
    }
  }
}