Skip to content
FeedbackDashboard

Get diagnostics for a build

builds.diagnostics.list(build_id, **kwargs) -> Page<BuildDiagnostic { code, ignored, level, 4 more } >
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: String

Build ID

cursor: String

Pagination cursor from a previous response

limit: Float

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

exclusiveMinimum0
maximum100
severity: :fatal | :error | :warning | :note

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

Accepts one of the following:
:fatal
:error
:warning
:note
targets: String

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

ReturnsExpand Collapse
class BuildDiagnostic { code, ignored, level, 4 more }
code: String

The kind of diagnostic.

ignored: bool

Whether the diagnostic is ignored in the Stainless config.

level: :fatal | :error | :warning | :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:
class Markdown { markdown, type }
markdown: String
type: :markdown
class Raw { raw, type }
raw: String
type: :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.

Get diagnostics for a build

require "stainless_v0"

stainless = StainlessV0::Client.new(
  api_key: "My API Key",
  environment: "staging" # defaults to "production"
)

page = stainless.builds.diagnostics.list("buildId")

puts(page)
{
  "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"
}