Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2946

REST: Respond an error if the incoming JSON can not be parsed

    XMLWordPrintable

    Details

      Description

      Someone tries to create a group via the REST API

      PUT http://localhost:8080/olat/restapi/groups
      {"description":"Test","externalId":'null',"managedFlags":'null',"name":"TestGroup","minParticipants":'null',"maxParticipants":'null'}
      

      This request results in a https status 200 but the group is not created in OpenOLAT.

      The reason for the missing group is that the parsing of the JSON fails because the 'null' (with apostrophe) can not be mapped to an Integer. In this case the http status 500 (Internal Server Error) should be responded instead of the http status code 200 (OK).

        Attachments

          Activity

            People

            Assignee:
            uhensler Urs Hensler
            Reporter:
            gnaegi Florian Gn├Ągi
            Tester:
            Sabrina Scheiwiler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m