Fixed
Details
Assignee
Ryan McCauleyRyan McCauleyReporter
Wyclif LuyimaWyclif LuyimaComplexity
MediumFix versions
Priority
Should
Details
Details
Assignee
Ryan McCauley
Ryan McCauleyReporter
Wyclif Luyima
Wyclif LuyimaComplexity
Medium
Fix versions
Priority
Created October 18, 2022 at 4:32 AM
Updated March 15, 2024 at 3:25 PM
Resolved August 24, 2023 at 1:19 PM
Looks like property setters are called twice as seen https://github.com/openmrs/openmrs-module-webservices.rest/blob/2.37.0/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/ConversionUtil.java#L313-L332, for some resources this leads to a bug where if the setter is for a collection or an array, the collection items are added twice resulting in duplicates when creating a new resource that has a child collection.
I believe this can only be reproduced with 2 levels of nesting of collections e.g. a visit has a collection of encounters and each encounter can have a collection of obs, so if you try to create a new visit with an encounter with some observations.