Skip to content
Get started

Get diagnostics for a build

builds.diagnostics.list(strbuild_id, DiagnosticListParams**kwargs) -> SyncPage[BuildDiagnostic]
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.

ParametersExpand Collapse
build_id: str

Build ID

cursor: Optional[str]

Pagination cursor from a previous response

limit: Optional[float]

Maximum number of diagnostics to return, defaults to 100 (maximum: 100)

exclusiveMinimum0
maximum100
severity: Optional[Literal["fatal", "error", "warning", "note"]]

Includes the given severity and above (fatal > error > warning > note).

Accepts one of the following:
"fatal"
"error"
"warning"
"note"
targets: Optional[List[Target]]

Optional list of language targets to filter diagnostics by

Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
ReturnsExpand Collapse
class BuildDiagnostic:
code: str

The kind of diagnostic.

ignored: bool

Whether the diagnostic is ignored in the Stainless config.

level: Literal["fatal", "error", "warning", "note"]

The severity of the diagnostic.

Accepts one of the following:
"fatal"
"error"
"warning"
"note"
message: str

A description of the diagnostic.

more: Optional[BuildDiagnosticMore]
Accepts one of the following:
class Markdown:
markdown: str
type: Literal["markdown"]
Accepts one of the following:
"markdown"
class Raw:
raw: str
type: Literal["raw"]
Accepts one of the following:
"raw"
config_ref: Optional[str]

A JSON pointer to a relevant field in the Stainless config.

oas_ref: Optional[str]

A JSON pointer to a relevant field in the OpenAPI spec.

Get diagnostics for a build
from stainless_v0 import Stainless

client = Stainless(
    api_key="My API Key",
)
page = client.builds.diagnostics.list(
    build_id="buildId",
)
page = page.data[0]
print(page.code)
{
  "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"
}
Returns Examples
{
  "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"
}