Skip to content

Ask the AI for a patch that fixes one finding (REQ-025). The doc does not change. An answer finding needs the author's answer.

POST
/runs/{runId}/findings/{findingId}/fix
curl --request POST \
--url https://example.com/api/v1/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/findings/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fix \
--header 'Content-Type: application/json' \
--data '{ "answer": "example", "option": 1 }'
runId
required
string format: uuid
findingId
required
string format: uuid
Media typeapplication/json
object
answer

For an answer finding, the fact the author gives. Speccy writes it into the doc in the doc’s style.

string
option

The option of a material gap that the answer is, 1 or 2, or 0 for the author’s own words.

integer
<= 2
Examplegenerated
{
"answer": "example",
"option": 1
}

The suggested patch.

Media typeapplication/json

A patch that replaces one text in one file (REQ-025). Speccy picks the text: the paragraph or the section of the finding, or no text when the fix adds a section. The model writes only the new text.

object
finding_id
required
string format: uuid
file
required
string
old
required

The text the patch replaces. Empty when the patch adds text.

string
new
required
string
line
required

The line where the replaced text starts, or where the new text goes, from 1.

integer
end_line
required
integer
explanation
required
string
version_id
required

The version the patch was written for.

string format: uuid
answers

For a patch from the questions screen, every finding whose answer it writes. finding_id is the first.

Array<string>
link_choices

For a missing upstream link, the docs the link can name. The patch is empty; the person picks one, and Speccy writes the link (#75).

Array<object>
object
doc_id
required
string format: uuid
title
required
string
path
required

The doc’s path relative to the root of its source.

string
profile
required
string
Examplegenerated
{
"finding_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"file": "example",
"old": "example",
"new": "example",
"line": 1,
"end_line": 1,
"explanation": "example",
"version_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"answers": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"link_choices": [
{
"doc_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"title": "example",
"path": "example",
"profile": "example"
}
]
}

An error.

Media typeapplication/problem+json

RFC 9457 problem details with a stable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required

A stable machine-readable error code.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": "example"
}