POST deaths requires too many parameters
Closed this issue · 4 comments
AChillFeeder commented
The model to POST a new DEATH is as follows:
{
"game": {
"champion": "KAISA",
"createdOn": "2021-06-13T18:44:31.796Z",
"id": 0,
"predicate": {},
"role": "ADC"
},
"id": 0,
"minute": 10,
"reason": {
"description": "",
"id": 104,
"predicate": {}
}
}
When it should only require game and reason ID.
Alternatively, using the model above with all the required data returns this error:
"message": "could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
"path": "/deaths"
medkhabt commented
You didn't specify the game id
, and when creating a Death
instance using that model, you don't need to specify all the fields for related game
and reason
.
For exemple you can do this instead:
{ "game": { "id": 1 }, "minute": 10, "reason": { "id": 104 } }
AChillFeeder commented
Using your request still returns an internal server error
"message": "could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
"path": "/deaths"
medkhabt commented
medkhabt commented
The issue has been discussed privately, and we concluded that it isn't an issue.