Closed edager closed 7 months ago
This is likely related to a previously observed error that occurs for incompletely filled objects. The cause appears to be that partially filling certain elements results in the frontend returns an array instead of an object which gives rise to a json schema validation error (example error):
"PUT /api/mbdb-mst/7tsz3-ss856/draft HTTP/1.1" 500 -
.
.
.
jsonschema.exceptions.ValidationError: [{'inchikey': 'something long ', 'molecular_weight': {'unit': 'kDa', 'value': 7.0}, 'name': 'long name', 'type': 'Chemical'}] is not of type 'object'
Getting a 500 here is odd. If the frontend deposited invalid data, the backend should catch it report it back with a 400 (?) error code. Solvent
is supposed to be a list of Entity
items so having an array here seems correct.
A working minimal example to provoke this error is to post the following:
{
"metadata": {
"general_parameters": {
"depositors": {
"principal_contact": {
"family_name": "d",
"given_name": "e"
}
},
"entities_of_interest": [
{
"type": "Polymer",
"name": "l"
}
]
}
}
}
Note that the following (also incomplete) example that gives the intended behaviour is:
{
"metadata": {
"general_parameters": {
"depositors": {
"principal_contact": {
"family_name": "d",
"given_name": "e"
}
}
}
}
}
This was fixed the affected dependency, see https://github.com/oarepo/oarepo-runtime/pull/172
While trying to save after entering solvent details, I got this error message (09:00 23/11-2023)
500 error
Trying again at 09:04 it appeared to have saved…