Skip to content
FeedbackDashboard

Get diagnostics for a build

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.

Path ParametersExpand Collapse
buildId: string

Build ID

Query ParametersExpand Collapse
cursor: optional string

Pagination cursor from a previous response

limit: optional number

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

exclusiveMinimum0
maximum100
severity: optional "fatal" or "error" or "warning" or "note"

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

Accepts one of the following:
"fatal"
"error"
"warning"
"note"
targets: optional string

Optional comma-delimited list of language targets to filter diagnostics by

ReturnsExpand Collapse
data: array of BuildDiagnostic { code, ignored, level, 4 more }
code: string

The kind of diagnostic.

ignored: boolean

Whether the diagnostic is ignored in the Stainless config.

level: "fatal" or "error" or "warning" or "note"

The severity of the diagnostic.

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

A description of the diagnostic.

Accepts one of the following:
Markdown = object { markdown, type }
markdown: string
type: "markdown"
Raw = object { raw, type }
raw: string
type: "raw"
config_ref: optional string

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

oas_ref: optional string

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

has_more: boolean
next_cursor: optional string
Get diagnostics for a build
curl https://api.stainless.com/v0/builds/$BUILD_ID/diagnostics \
    -H "Authorization: Bearer $STAINLESS_API_KEY"
{
  "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"
}