As a Wikidata gadget developer I want to know what part of my input caused an error so that I can adjust my code and make successful edits as intended.
Changes to make to errors on POST, PUT, and PATCH requests.
<table>
<tr>
<th>description</th>
<th>current error</th>
<th>intended error</th>
</tr>
<tr>
<td>missing required field</td>
<td>`invalid-statement-data`</td>
<td>`code: statement-data-missing-field`
`message: Mandatory field missing in the statement data: {field}`
`context: { path: FIELD }`
</td>
</tr>
<tr>
<td>invalid data entered in the field</td>
<td>`invalid-statement-data`</td>
<td>`code: statement-data-invalid-field`
`message: Invalid input for {field}`
`context: { path: FIELD, value: VALUE }`
</td>
</tr>
<tr>
<td>missing required field in the patched statement</td>
<td>`patched-statement-invalid`</td>
<td>`code: patched-statement-invalid-missing-field`
`message: Mandatory field missing in the patched statement: {field}`
`context: { path: FIELD }`
</td>
</tr>
<tr>
<td>invalid data entered in the field in the patched statement</td>
<td>`patched-statement-invalid`</td>
<td>`code: patched-statement-invalid-invalid-field`
`message: Invalid input for {field} in the patched statement`
`context: { path: FIELD, value: VALUE }`
</td>
</tr>
</table>
`{field}` is to be the easy "field name" that can be provided in the current implementation. Should it be impossible in some cases (e.g. PATCH) to say even that, `{field}` could potentially be skipped entirely.