0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added 'property' field to errors returned from API

refs #10438
This commit is contained in:
Nazar Gargol 2019-02-26 13:41:13 +07:00
parent bd904cd8e1
commit 3baf52fba9
5 changed files with 8 additions and 0 deletions

View file

@ -29,6 +29,7 @@ const validate = (schema, definitions, data) => {
message: common.i18n.t('notices.data.validation.index.schemaValidationFailed', {
key: key
}),
property: key,
errorDetails: validation.errors
}));
}

View file

@ -128,6 +128,7 @@ _private.JSONErrorRendererV2 = (err, req, res, next) => { // eslint-disable-line
context: userError.context || null,
type: err.errorType || null,
details: err.errorDetails || null,
property: err.property || null,
help: err.help || null,
code: err.code || null,
id: err.id || null

View file

@ -113,6 +113,7 @@ describe('Posts API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'
@ -203,6 +204,7 @@ describe('Posts API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'

View file

@ -69,6 +69,7 @@ describe('Settings API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'
@ -133,6 +134,7 @@ describe('Settings API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'

View file

@ -63,6 +63,7 @@ describe('User API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'
@ -92,6 +93,7 @@ describe('User API', function () {
'context',
'type',
'details',
'property',
'help',
'code',
'id'