TypeScript · Schema

TypeScript Diagnostic

A compiler diagnostic message (error, warning, or suggestion) produced by the TypeScript Compiler API

CompilerJavaScriptLanguage ServiceProgramming LanguageStatic TypingWeb Development

Properties

Name Type Description
file object The source file in which the diagnostic occurred
start integer Character offset in the source file where the diagnostic starts
length integer Length of the diagnostic span in characters
messageText object The diagnostic message text
category integer 0=Warning, 1=Error, 2=Suggestion, 3=Message
code integer Numeric TypeScript error code (e.g., 2345)
source string Optional source identifier for the diagnostic
View JSON Schema on GitHub

JSON Schema

typescript-diagnostic-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.typescriptlang.org/schemas/diagnostic",
  "title": "TypeScript Diagnostic",
  "description": "A compiler diagnostic message (error, warning, or suggestion) produced by the TypeScript Compiler API",
  "type": "object",
  "required": ["messageText", "category", "code"],
  "properties": {
    "file": {
      "type": "object",
      "description": "The source file in which the diagnostic occurred",
      "properties": {
        "fileName": {
          "type": "string",
          "description": "Path to the source file"
        }
      }
    },
    "start": {
      "type": "integer",
      "description": "Character offset in the source file where the diagnostic starts"
    },
    "length": {
      "type": "integer",
      "description": "Length of the diagnostic span in characters"
    },
    "messageText": {
      "oneOf": [
        {"type": "string"},
        {
          "type": "object",
          "description": "Chained diagnostic message",
          "properties": {
            "messageText": {"type": "string"},
            "category": {"type": "integer"},
            "code": {"type": "integer"},
            "next": {"type": "array"}
          }
        }
      ],
      "description": "The diagnostic message text"
    },
    "category": {
      "type": "integer",
      "enum": [0, 1, 2, 3],
      "description": "0=Warning, 1=Error, 2=Suggestion, 3=Message"
    },
    "code": {
      "type": "integer",
      "description": "Numeric TypeScript error code (e.g., 2345)"
    },
    "source": {
      "type": "string",
      "description": "Optional source identifier for the diagnostic"
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/typescript-diagnostic"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.