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.
description | current error | intended error |
---|---|---|
missing required field | invalid-statement-data | code: statement-data-missing-field message: Mandatory field missing in the statement data: {field} context: { path: FIELD } |
invalid data entered in the field | invalid-statement-data | code: statement-data-invalid-field message: Invalid input for {field} context: { path: FIELD, value: VALUE } |
missing required field in the patched statement | patched-statement-invalid | code: patched-statement-missing-field message: Mandatory field missing in the patched statement: {field} context: { path: FIELD } |
invalid data entered in the field in the patched statement | patched-statement-invalid | code: patched-statement-invalid-field message: Invalid input for {field} in the patched statement context: { path: FIELD, value: VALUE } |
{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.