Discussions

Ask a Question
Back to All

v1-API Returns variable data type for employee workschedule

Hello,

we encountered a case where the API returns an empty list as shown below

"work_schedule": {
  "label": "Work schedule",
  "value": [],
  "type": "standard",
  "universal_id": "work_schedule"
},

for the workschedule attribute of an employee instead of an object as ususal e.g.

 "work_schedule": {
      "label": "Work schedule",
      "value": {
        "type": "WorkSchedule",
        "attributes": {
          "id": 1,
          "name": "schedule",
          "valid_from": "2023-05-05",
          "monday": "08:00",
          "tuesday": "08:00",
          "wednesday": "08:00",
          "thursday": "08:00",
          "friday": "08:00",
          "saturday": "00:00",
          "sunday": "00:00"
        }
      },
      "type": "standard",
      "universal_id": "work_schedule"
    },

This switch between a list and an object causes issues with the parsing. Is this behavior intended? If yes are there other attributes where this can happen ?