# Diagnostics ## Get diagnostics for a build `client.builds.diagnostics.list(stringbuildID, DiagnosticListParamsquery?, RequestOptionsoptions?): Page` **get** `/v0/builds/{buildId}/diagnostics` Get the list of diagnostics for a given build. If no language targets are specified, diagnostics for all languages are returned. ### Parameters - `buildID: string` Build ID - `query: DiagnosticListParams` - `cursor?: string` Pagination cursor from a previous response - `limit?: number` Maximum number of diagnostics to return, defaults to 100 (maximum: 100) - `severity?: "fatal" | "error" | "warning" | "note"` Includes the given severity and above (fatal > error > warning > note). - `"fatal"` - `"error"` - `"warning"` - `"note"` - `targets?: string` Optional comma-delimited list of language targets to filter diagnostics by ### Returns - `BuildDiagnostic` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" | "error" | "warning" | "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore | null` - `Markdown` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref?: string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref?: string` A JSON pointer to a relevant field in the OpenAPI spec. ### Example ```typescript import Stainless from '@stainless-api/sdk'; const client = new Stainless({ apiKey: process.env['STAINLESS_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const buildDiagnostic of client.builds.diagnostics.list('buildId')) { console.log(buildDiagnostic.code); } ``` #### Response ```json { "data": [ { "code": "code", "ignored": true, "level": "fatal", "message": "message", "more": { "markdown": "markdown", "type": "markdown" }, "config_ref": "config_ref", "oas_ref": "oas_ref" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Domain Types ### Build Diagnostic - `BuildDiagnostic` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" | "error" | "warning" | "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore | null` - `Markdown` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref?: string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref?: string` A JSON pointer to a relevant field in the OpenAPI spec. ### Build Diagnostic More - `BuildDiagnosticMore = Markdown | Raw` - `Markdown` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw` - `raw: string` - `type: "raw"` - `"raw"`