I have a JSONObject in which keys are stored as jsonPath and I want to create a JSON.
{
"officeName": "string",
"bookingPolicies.spocCancelCutOff": 0,
"bookingPolicies.remoteSignInAllowed": true,
"bookingPolicies.wfhScheduleCutOff": 1,
"bookingPolicies.editBookingEnabled": true,
"bookingPolicies.wfhMaxDurationForBooking": 1,
"bookingPolicies.expiryCutOffInMinutes": 15,
"bookingPolicies.expiryNotificationCutOffInMinutes": 40,
"bookingPolicies.wfhMinShiftDurationInMinute": 180,
"bookingPolicies.wfhMaxShiftDurationInMinute": 720,
"bookingPolicies.timeDiffShiftsMin": 1,
"bookingPolicies.employeeEndTimeBookingCutoff": 2,
"bookingPolicies.maxHoursAllowedForCheckin": 0,
"bookingPolicies.gatepassDelaycutoff": 0,
"bookingPolicies.numOfDays": 2,
"officeUUID": "a7829e63-3a80-4fca-abf6-3bc3d48832ee",
"bookingPolicies.wfhDisabled": true,
"bookingPolicies.checkInFirstPremise": false,
"bookingPolicies.maxShiftDuration": 0,
"bookingPolicies.limitEmployeeBookingDays": true,
"shiftSchedules.defineClockIn": true,
"bookingPolicies.wfhCancelCutOff": 1,
"bookingPolicies.onCallMinShiftDurationInMinute": 180,
"bookingPolicies.wfhBookingAllowed.key1": "val2",
"bookingPolicies.defLogoutDuration": 10,
"bookingPolicies.limitEmployeeBookingDaysUnit": 4,
"bookingPolicies.blockUserIfNotVaccinated": true,
"bookingPolicies.showParking": true,
"seatBooking.isAutoEntryAllowed": false,
"bookingPolicies.wfhBookingAllowed.key4.key2[0]": "val2",
"bookingPolicies.parkingSlotBufferTimeInMin": 1,
"bookingPolicies.bookingPerDayEmp": 12,
"bookingPolicies.defOnCallLogoutDurationInMinute": 540,
"bookingPolicies.employeeCancelCutOff": 5,
"bookingPolicies.minShiftDuration": 0,
"bookingPolicies.employeeScheduleCutoff": 2,
"bookingPolicies.defWfhLogoutDurationInMinute": 540,
"bookingPolicies.wfhEditCutOff": 1,
"bookingPolicies.onCallMaxShiftDurationInMinute": 720,
"bookingPolicies.wfhMonthlyLimit": 8,
"seatBooking.maxTimeBeforeClockin": false,
"bookingPolicies.bookingEditCutOff": 10,
"bookingPolicies.wfhClockInBuffer": 15,
"bookingPolicies.teamCalendarEnabled": true,
"bookingPolicies.seatBookingEnabled": true,
"bookingPolicies.enableRecurrenceOnTeamPlanner": true,
"bookingPolicies.wfhSpocSchecduleCutOff": 1,
"bookingPolicies.wfhWeeklyLimit": 2,
"bookingPolicies.employeeEndTimeScheduleCutoff": 0,
"bookingPolicies.wfhSpocEditCutOff": 1,
"bookingPolicies.minHoursAllowedForCheckin": 0,
"bookingPolicies.maxBufferForCheckin": 3,
"bookingPolicies.bookingLogoutEditCutOff": 0,
"bookingPolicies.spocScheduleCutOff": 0,
"bookingPolicies.wfhMinBetweenClockInClockOut": 0
}
I am using recursive approach but I am not able to create nested jsonObject and arrayValues. Any library suggestions would also be great. Or how to use JsonObjects to create nested json.