inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 84 forks source link

Validation errors don't get passed for resource_type #76

Closed tmorrell closed 4 years ago

tmorrell commented 4 years ago

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 includes Invalid 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."}

fenekku commented 4 years ago

@tmorrell To double-check: is the main issue the helpful list or a missing message in 'errors' ?

tmorrell commented 4 years ago

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.

fenekku commented 4 years ago

Got it. Thanks!