Closed tmorrell closed 4 years ago
@tmorrell To double-check: is the main issue the helpful list or a missing message in 'errors' ?
Main issue is not having a helpful list. It’s hard to figure out what the accepted values are (in the schema, marshmallow, somewhere else?)
On Mar 23, 2020, at 2:07 PM, fenekku notifications@github.com wrote:
@tmorrellhttps://github.com/tmorrell To double-check: is the main issue the helpful list or a missing message in 'errors' ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/inveniosoftware/invenio-rdm-records/issues/76#issuecomment-602856347, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSMOGT6GCT3HXLT3CIGC4LRI7FPTANCNFSM4LF4YQ5A.
Got it. Thanks!
Typically when one creates a record with an incorrect field a validation error with helpful message is returned:
e.g.
'titles': [{'title': 'A Romans story', 'type': 'Otherss', 'lang': 'eng'}]
returns an errors field that includesInvalid title type. Otherss not one of MainTitle, AlternativeTitle, Subtitle, TranslatedTitle, Other
However when one provides an incorrect resource_type in either the type or subtype field no errors field is returned:
e.g.
'resource_type': {'type': 'imagess', 'subtype': 'photo'}
only returns{"status": 400, "message": "Validation error."}