Skip to content

Write the answers of the questions screen into the doc as patches. The doc does not change. Answers whose text overlaps share one patch. A patch that suggestFix wrote for the same answer on the current version is reused.

POST
/runs/{runId}/answers
curl --request POST \
--url https://example.com/api/v1/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/answers \
--header 'Content-Type: application/json' \
--data '{ "answers": [ { "finding_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "answer": "example", "option": 1 } ] }'
runId
required
string format: uuid
Media typeapplication/json
object
answers
required
Array<object>
>= 1 items
object
finding_id
required
string format: uuid
answer
required
string
option
integer
<= 2
Examplegenerated
{
"answers": [
{
"finding_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"answer": "example",
"option": 1
}
]
}

The patches.

Media typeapplication/json
object
patches
required

One patch for each part of the doc. Two answers about one paragraph share a patch. Accept them with acceptFixes, by the finding_id of each patch.

Array<object>

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
{
"patches": [
{
"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"
}