holisticon / ranked

Tracking kicker results
Other
22 stars 0 forks source link

Cannot POST results #53

Closed timostuebing closed 6 years ago

timostuebing commented 6 years ago

In the file frontend/src/main/js/pages:sendResults() I am sending the following POST to http://localhost:8080/command/match:

{ "teamRed":{ "player1":{ "value":"danielsteinhoefer" }, "player2":{ "value":"detlefvonderthuesen" } }, "teamBlue":{ "player1":{ "value":"lukastaake" }, "player2":{ "value":"leonfausten" } }, "matchSets":[ { "goalsRed":6, "goalsBlue":0, "offenseRed":{ "value":"danielsteinhoefer" }, "offenseBlue":{ "value":"lukastaake" } }, { "goalsRed":0, "goalsBlue":6, "offenseRed":{ "value":"detlefvonderthuesen" }, "offenseBlue":{ "value":"leonfausten" } } ], "type":"result" }

Unfortunately the validation fails with the following console output:

2018-01-26 16:11:48.431 WARN 65859 --- [nio-8081-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Missing type id when trying to resolve subtype of [simple type, class de.holisticon.ranked.model.AbstractMatchSet]: missing type id property 'type' (for POJO property 'matchSets'); nested exception is com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class de.holisticon.ranked.model.AbstractMatchSet]: missing type id property 'type' (for POJO property 'matchSets') at [Source: (PushbackInputStream); line: 1, column: 298] (through reference chain: de.holisticon.ranked.command.api.CreateMatch["matchSets"]->java.util.ArrayList[0])